Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-12-27 19:40:49


Jonathan Turkanis wrote:
> David Greene wrote:
>> I asked this question a year or two ago on the list.
>>
>> Has anyone come up with a good way to dump template metaprogramming
>> information at compile time? I'd like to be able to do this both
>> in a "print" sense (compiler warnings) and an "error" sence (compiler
>> abort).
>
> I think <boost/mpl/print.hpp> is supposed to do this, although I'm not sure how
> well it works over a wide range of compilers.
>
>> I hacked something together last week that sort of does the job.
>> There's a print<Message, FileLine> class that has a constructor with
>> an unused variable declared. gcc gives a nice warning with -Wall.
>> I also have some hacked macros to pass file and line number
>> information
>> to the printer.
>
> I think you'll find that different compilers give very different results. I
> suggest you try it on three or four compilers, at least.

David, if you find that your print template works on some compilers or
in some configurations where the MPL one doesn't, I'd be very eager to
fold your technology for those compilers into the MPL version.

Thanks,

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk