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-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