The following code works on Visual Studio 2005, but gives me a compiler error when compiled with g++ 4.4.5:
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
template<int X> struct A
{
void f() {
typedef boost::mpl::if_<boost::mpl::bool_<X == 1>, int, bool>::type Type;
}
};
This is the error I get:
main.cpp: In member function ‘void A<X>::f()’:
main.cpp:12: error: too few template-parameter-lists
What's wrong with the code? If I replace the templated X with a hard coded number, the code compiles just fine. I've also tried wrapping X with a mpl::int_ type but without any success.
Thanks!