Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2004-12-28 05:39:09


Arkadiy Vertleyb writes:
> "Aleksey Gurtovoy" <agurtovoy_at_[hidden]> wrote
> > True. I'd like to see specific instances of the conflicting code.
>
> Here is an emulation -- I use my own unqualified call instead of STL (and
> AFAIK g++ STL makes lots of unqualified calls):
>
> ----------- a.cpp --------------------------------
>
> #include <boost/mpl/find.hpp>
> #include <boost/mpl/vector.hpp>
>
> namespace X
> {
> template<class T>
> void find(const T&)
> {}
> template<class T> struct row
> {};
> void foo()
> {
> find(row<boost::mpl::vector0<> >());
> }
> }
>
> int main()
> {
> X::foo();
> return 0;
> }

In general, MPL works around this GCC quirk by putting its "data types"
into an unrelated namespace ('mpl_') and bringing them into 'boost::mpl'
through a 'using' directive/declarations. This breaks the ADL link
between the data types and the algorithms, resolving the issue for many
typical use cases.

The reason why the above fails is that currently the workaround is not
applied to MPL sequences (it was planned, but never implemented). I'll
look into fixing this for the next release.

--
Aleksey Gurtovoy
MetaCommunications Engineering

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk