Boost logo

Boost :

Subject: Re: [boost] identification versus demangle
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-07-12 05:34:39


On 07/11/2011 01:02 AM, Gordon Woodhull wrote:
>
> On Jul 10, 2011, at 3:08 PM, Mathias Gaunard wrote:
>> On 07/10/2011 08:17 PM, Gordon Woodhull wrote:
>>> It would be annoying to users to have to register every type in their graph/state machine, so I guess I'm wondering if demangle(typeid(T).typename()) is impossible on a lot of compilers.
>>
>> Why not print things at compile time through a warning?
>
> Interesting. I could wrap the types in something easy to find and then not worry about compiler differences.
>
> Related question, then: why has mpl::print<> never worked for me on gcc?
>
> template<typename E>
> void operator()(found_edge<E>) {
> typename mpl::print<E>::type foo; // nothing happens
>
> Is there an alternative? I just end up hacking my own errors when I have to debug stuff, but that won't work here.

That could be a defect of mpl::print.

I believe the following implementation works reliably well with GCC.

template<class T>
struct print
{
     typedef T type;
     unsigned : 80;
};


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