
5 Apr
2010
5 Apr
'10
9:17 p.m.
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