
Vladimir Prus <ghost@cs.msu.su> writes:
David Abrahams wrote:
Well, I can tell one third of the story. The reverse_iter_fold.hpp has this:
namespace boost { namespace mpl {
template< typename BOOST_MPL_AUX_NA_PARAM(Sequence) , typename BOOST_MPL_AUX_NA_PARAM(State) , typename BOOST_MPL_AUX_NA_PARAM(BackwardOp) , typename ForwardOp = arg<1>
According to the error message, gcc associates 'arg<1>' with boost::arg (from bind/arg.hpp), while most likely mpl::arg<1> was meant. Two remaining questions are - why gcc does that.
GCC applies "ADL" to almost everything. It's ridiculous.
Do you know if there is bug report about this? I could not find any in gcc's bugzilla. Besides, I'm not sure gcc is at fault. Here's a completely distilled testcase:
namespace boost { template<int I> class arg {}; }
namespace mpl_ { template< int N > struct arg {}; }
namespace boost { namespace mpl {
using namespace mpl_;
template<typename ForwardOp = arg<1> > struct XXX {
IIRC, the 'arg' visible via using is considered to be declared in the nearest namespace enclosing both mpl_ and boost::mpl -- which is global namespace. So boost::arg hides mpl_::arg. For explicit mpl::aux, the name lookup ignores the 'boost' namespace.
But the fact that explicit qualification doesn't fix it is surely a bug? -- Dave Abrahams Boost Consulting http://www.boost-consulting.com