Subject: Re: [boost] Formal Review Request: Boost.Convert
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-02-28 11:48:24


AMDG

Emil Dotchevski wrote:
> What's wrong with the following call syntax:
>
> boost::convert<target>( source const & [,arg1,arg2,...] )
>
> that is, the caller provides the target type for the conversion, then
> the first argument is considered the source (deduced automatically),
> and the rest of the arguments configure the conversion.
>
> Going back to my uuid example, uuid.hpp could simply say:
>
> #include <string>
>
> namespace user {
> class uuid;
> template <class Target> Target convert( uuid const & );
> template <> std::string convert<std::string>( uuid const & );
> }
>

This overload of convert cannot reliably be found as the
syntax convert<std::string>(...) doesn't invoke ADL.
(At least, not according to the standard. Some compilers
perform ADL in this case anyway)

In Christ,
Steven Watanabe