
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Dave Abrahams Sent: 08 September 2010 14:58 To: boost-users@lists.boost.org Subject: Re: [Boost-users] trick to print a type at compile-time
On Wed, Sep 8, 2010 at 8:56 AM, Eric Niebler <eric@boostpro.com> wrote:
boost::mpl::print in boost/mpl/print.hpp. Neither seem to be documented.
mpl::print is mostly good for those cases where you need to *not* cause a compilation error, perhaps because you are trying to follow recursive instantiations. Otherwise, I'd go with an explicit error; you'll get less noise.
I tried both ways: boost::mpl::print<result_type> myvar; and template <typename T> struct print_error { }; typedef typename print_error<result_type>::type my_print_error; my_print_error myvar; In both cases, the bit in the error in msvc2008 just shows: 1> with 1> [ 1> T=result_type 1> ] it doesn't print what that type actually is. regards,