Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-12-21 09:51:52


On Tue, Dec 21, 2004 at 10:46:44AM -0000, John Maddock wrote:

> >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;
> >}
> >----------------------------------
> >
> >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
> >Sequence,
> > 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'
>
> Surely that's a gcc bug (anyone reported this?), there is no argument to
> find that is in the mpl namespace, an X::row<boost::mpl::vector0<> >
> doesn't count!

Comeau considers boost::mpl::find if its a function, but not if it's a
type. That implies it should be looking in that namespace. The problem
is that GCC finds non-functions by ADL, which is bug 17365.

jon

-- 
"Ye have locked yerselves up in cages of fear;
 and behold, do ye now complain that ye lack freedom."
	- Lord Omar Khayyam Ravenhurst
	  "Epistle to the Paranoids," HBT

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