|
Boost : |
Subject: Re: [boost] [mpl] is_macro_called
From: Pierre Morcello (pmorcell-cppfrance_at_[hidden])
Date: 2010-04-05 17:17:16
Lorenzo Caminiti wrote:
> Is there a way I can do this without using #instructions programmed
> outside the macro definition?
As I said, I don't see how to do it in pure C++. But if we go away from pure C++ macro, if you use a code generator / custom preprocessor (modifying boost.wave?), it seems quite feasable, and in a very portable manner. Personnaly I think a code generator would do the trick without difficulties (use boost.spirit to roll it quick!).
Eg :
struct X
{
TRACK(NameOfTheMacroToTrack)
fn()
{
NameOfTheMacroToTrack(X,Y,Z))
}
TRACKEND(NameOfTheMacroToTrack)
};
Seems ok, isn't it? I think with only the first TRACK it is even possible to do it easily. - Be sure to ignore comments thought -.
Best regards,
Pierre Morcello
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk