[mpl::print] Making mpl::print<> function

I have the following which I expect to produce a compile time warning which includes the type name but it fails to do so. I found this in the C++ Template Metaprogramming book - but not in the MPL documentation. What am I missing here? Robert Ramey #include <boost/mpl/print.hpp> template<class T> int f(){ boost::mpl::print<T>; //static int x = g<T::value>(); return x; } struct A { BOOST_STATIC_CONSTANT(bool, value = false); }; ... int x = f<A>();

I have the following which I expect to produce a compile time warning which includes the type name but it fails to do so. I found this in the C++ Template Metaprogramming book - but not in the MPL documentation. What am I missing here?
Robert Ramey
#include <boost/mpl/print.hpp> template<class T> int f(){ boost::mpl::print<T>;
Try: boost::mpl::print<T> abc; instead
//static int x = g<T::value>(); return x; }
struct A { BOOST_STATIC_CONSTANT(bool, value = false); };
... int x = f<A>();
Regards Hartmut

I have the following which I expect to produce a compile time warning which includes the type name but it fails to do so. What do you want to do ? Having compile-warning or debugging a given
Robert Ramey wrote: piece of tempalte meta-program ? If the later, look up the identification library in the vault, it'll help you get runtime display of types in readbale format. -- ___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35
participants (3)
-
Hartmut Kaiser
-
joel
-
Robert Ramey