Boost logo

Boost :

Subject: Re: [boost] GDB-like debugger for template metaprograms
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2014-11-29 17:06:55


On 29/11/2014 22:15, Abel Sinkovics wrote:
> Hi Mathias,
>
> Thank you for checking it.
>
> On 2014-11-29 18:56, Mathias Gaunard wrote:
>> - pretty printing complex types so that you can actually read them
>> I don't think the formatter thing is a solution.
>> Consider an arbitrarily deep expression template tree, for example.
> We have some ideas on how to improve pretty printing of types and
> displaying complex template instances based on our own experience.
>
> How would you change/improve pretty printing in a way you find useful?
> How would you display for example a deep expression template tree?

It can be hard to match '<' and '>' together for long symbol names
involving instantiations of templates where the parameters are
themselves template instantiations.

I think it would be great to have an option to automatically indent the
type when printing so that it's easier to interpret.

Instead of
a<b,c<d>,e<f<g,h>>,i>, you could print it as

a<
   b,
   c<d>,
   e<
     f<g, h>
>,
   i
>

My example is still relatively short and uses one-letter names, but with
real cases it can quickly become unreadable (just try reading
Boost.Proto expression templates types without indentation, it's pretty
horrible)

In any case, my other suggestion is probably more important: I'd like to
be able to use this tool to track how a specific instantiation happens,
and since I'm working on a large project I'd need to have the reference
of where the template being instantiated is and where the instantiation
occurs.


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