From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2004-12-21 00:00:04
"Aleksey Gurtovoy" <agurtovoy_at_[hidden]> wrote
> David Abrahams writes:
> > Arkadiy Vertleyb wrote:
> > > Hi all,
> > >
> > > I was porting my older stuff into Boost 1.32, and it went fine with
> > > However, using g++ 3.3, I ran into a lot of naming conflicts between
> > > MPL algoritms, such as find_if, copy_if, etc. From looking into
> > > posts, I can see that tis relates to a combination of problems in the
> > > STL, such as using unqualified calls, and ADL not working correctly.
> > >
> > > Does anybody know if the problem was fixed in later versions of GCC?
> > That's rather disturbing to hear. I know that for 1.32 Aleksey jumped
> > through considerable hoops specifically to avoid unintentional ADL
> > effects that crop up with GCC because of its "interesting
> > interpretation" of the standard. If anything, 1.32 should be much
> > better than previous versions in this regard.
> 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 --------------------------------
void find(const T&)
template<class T> struct row
The result is:
C:\ark\gcctest>g++ -I c:\boost\boost_1_32_0 a.cpp
c:/boost/boost_1_32_0/boost/mpl/find.hpp: In function `void X::foo()':
c:/boost/boost_1_32_0/boost/mpl/find.hpp:29: error: `template<class
class T> struct boost::mpl::find' is not a function,
a.cpp:8: error: conflict with `template<class T> void X::find(const T&)'
a.cpp:13: error: in call to `find'
As you can see, the parameter to foo() makes the compiler consider the
boost::mpl namespace for ADL. The combination of unqualified call and g++
finding class templates during ADL produces the error.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk