Boost logo

Boost :

From: Joel de Guzman (djowel_at_[hidden])
Date: 2003-09-17 08:15:15


Consider the following code:

#include <boost/mpl/if.hpp>
#include <boost/mpl/int.hpp>

namespace X
    template <int N>

    using namespace X;

g++ (3.2) complains:

In function `int main()':
template<class C, class T1, class T2> struct boost::mpl::if_' is not a function,
conflict with `template<int N> void X::if_(boost::mpl::int_<N>)'
in call to `if_'

VC7.1 is OK.

This is, AFAICT, an ADL (Koenig-lookup) problem. Which is correct, g++ or
VC7.1? In any case, this is a real problem with libraries that, directly or indirectly,
use MPL types. Is there a known solution (apart from asking the user to prefix
if_ with X::) ?


Joel de Guzman

Boost list run by bdawes at, gregod at, cpdaniel at, john at