Boost logo

Boost :

Subject: Re: [boost] [mpl] Using apply with gcc error
From: Jeffrey Lee Hellrung, Jr. (jhellrung_at_[hidden])
Date: 2011-02-03 17:58:05


On 2/3/2011 2:42 PM, Edward Diener wrote:
> Compiling this code with gcc:
>
> #include <boost/config.hpp>
> #include <boost/mpl/apply.hpp>
>
> template
> <
> class MF,
> class T
> >
> struct myMF :
> boost::mpl::apply<MF,T>
> {
> BOOST_STATIC_CONSTANT(bool,value=type::value);

AFAIK, since type resides in the base class, which is a dependent type,
the compiler won't look in the base class for type; it's looking in
namespace scope and there's no type at namespace scope. So you either
need a using declaration or explicit qualification. (Some versions of
MSVC, at least, happily but incorrectly accept the above code.)

Sorry, no references handy :(

> };
[...]

HTH,

- Jeff


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