Boost logo

Boost :

From: João Abecasis (jpabecasis_at_[hidden])
Date: 2006-03-01 14:26:09


Hi!

Using current CVS or version 1.33.1 the following simplified test case
fails to compile with gcc 4.0.2

     #include <boost/mpl/lambda.hpp>

     int main()
     {
         using boost::mpl::lambda;

         typedef lambda<lambda<int> >::type type;
     }

What I'm actually trying to do is

     mpl::transform<
         PredSequence,
         mpl::lambda<mpl::_1>
>

, where PredSequence is a MPL Sequence. The result of this operation is
subsequently used with fold/reverse_fold to chain together all the
metafunctions in PredSequence and create a single metafunction, where
the result of one metafunction is passed as argument to the next.

For the current CVS HEAD the errors I get with the above test case are,

boost/mpl/aux_/preprocessed/gcc/template_arity.hpp: In instantiation of
‘boost::mpl::aux::template_arity<T1>’:
test.cpp:7: instantiated from here
boost/mpl/aux_/preprocessed/gcc/template_arity.hpp:98: error:
‘boost::mpl::aux::template_arity<T1>::value’ is not a valid template
argument for type ‘int’ because it is a non-constant expression
test.cpp: In function ‘int main()’:
test.cpp:7: error: ‘boost::mpl::aux::template_arity<T1>::value’ is not a
valid template argument for type ‘int’ because it is a non-constant
expression
test.cpp:7: error: ‘boost::mpl::aux::template_arity<T1>::value’ is not a
valid template argument for type ‘int’ because it is a non-constant
expression

The full compiler version is 4.0.2 20051125 (Red Hat 4.0.2-8), from
Fedora Core 4. When using gcc 3.2.3 from the same linux distribution
both simplified test and the real use case compile cleanly.

Am I doing something wrong? What am I missing?

Best regards,

João


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