Re: [boost] boost::bind(f, ...) alternative syntax now in CVS
by David Abrahams other posts by this author
Oct 15 2002 12:45PM messages near this date
Re: [boost] boost::bind(f, ...) alternative syntax now in CVS
|
[boost] concept archetypes
"Peter Dimov" <pdimov@[...].net> writes:
> Bind now supports an alternative syntax that creates fewer problems with
> MSVC 6/7. Instead of
>
> boost::bind<R>(f, ...)
>
> you can now use
>
> boost::bind(boost::type<R>(), f, ...)
Specifically, any use of explicitly-specified function template
arguments will cause MSVC6 (and 7?) to "reserve" the name of the
function template, so that it cannot be used in another namespace to
define a class template, e.g.:
namespace lib1
{
template <class T> void bind(T* = 0);
bind((int*)0); // OK
bind<int> (); // <====== uh-oh
}
namespace lib2
{
template <class T> struct bind { }; // error appears here
}
...which is why the alternate syntax is important if you use MSVC
6/7. If you're targeting this compiler, it's important to provide
interfaces which don't require explicit specification of function
template arguments, or libraries that use your library will impose a
hidden limitation on users.
--
David Abrahams * Boost Consulting
dave@[...].com * http://www.boost-consulting.com
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Peter Dimov
Peter Dimov
David Abrahams
|