Boost logo

Boost :

Subject: Re: [boost] [preprocessor metaprogramming] tools
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2012-07-05 10:54:55

Nathan Ridge wrote
> I've noticed preprocessor metaprogramming has become more
> popular of late, both as a means to provide a cleaner alternative
> interface to a library (e.g. the DEFINE and ADAPT macros in
> Boost.Fusion or the proposed macro wrappers for Boost.TypeErasure)
> and as a means to emulate new language features (e.g.
> Boost.LocalFunction, Boost.Generic, and Boost.Contract).
> Sadly, IDE support for writing macro metaprograms is fairly poor
> in comparison to IDE support for writing regular C++ code.
> I wanted to share with you something I've found very useful for
> tracing/debugging macro metaprograms: the Eclipse CDT IDE has a
> "macro stepper" that allows you to step through the expansion of
> a macro step-by-step from the initial invocation to the final
> expansion. (This feature can be accessed by using the "Explore
> Macro Expansion" context menu item on a macro invocation.)
> I would be curious to hear what tools you have found useful for
> writing or debugging macro metaprograms.

I do this manually expanding the macros before compilation with -E -P
compiler options (or /EP...) and inspecting by eye the lengthy expanded
macro code. But I'm a vi guy that uses gdb and Linux command line -- so I
like things raw ;)

I was planning to use the Eclipse feature you indicated to benchmark macro
expansion times/steps in order to optimize my pp meta-programs but I didn't
get around to do that yet.


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at