Need help with Errors in boost MPL tutorials
Dear all,
I try to learn Meta-programing but i got stuck with lambda meta-function
and place holder.
I try to compile very simple program
#include
On Mon, Jan 23, 2012 at 6:03 PM, Linh Ha
Dear all,
I try to learn Meta-programing but i got stuck with lambda meta-function and place holder. I try to compile very simple program
#include
#include #include template
struct twice : F::template apply { }; template <class X> struct two_pointers : twice
>::type, X> {}; int main(int argc, char** argv) { return 0; } It is from the boost tutorial http://www.boost.org/doc/libs/** 1_48_0/libs/mpl/doc/tutorial/**the-lambda-metafunction.htmlhttp://www.boost.org/doc/libs/1_48_0/libs/mpl/doc/tutorial/the-lambda-metafu.... But it can not be complied. The error messages are
main.cpp:21: error: type/value mismatch at argument 1 in template parameter list for ‘template<class T> struct boost::add_pointer’ main.cpp:21: error: expected a type, got ‘<unnamed>::_1’ main.cpp:21: error: template argument 1 is invalid main.cpp:21: error: template argument 3 is invalid main.cpp:21: error: template argument 1 is invalid main.cpp:22: error: expected ‘::’ before ‘{’ token main.cpp:22: error: expected class-name before ‘{’ token
I use
g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
I have no idea what happened. Any inside would be appreciated. It is important I think since lambda is used all over place with MPL.
Thanks, Linh Ha
Just on a first glance, looks like you're mistaking ::_1 (placeholder from Boost.Bind) for boost::mpl::_1 (placeholder from Boost.MPL). They're incompatible; try using the latter...? - Jeff
participants (2)
-
Jeffrey Lee Hellrung, Jr.
-
Linh Ha