Boost logo

Boost :

From: Dylan Cuthbert (dylan_at_[hidden])
Date: 2002-06-25 21:37:17


I'd like to be able to assign a macro a new value from within another macro
definition. Actually, come to think about it, the ability to issue
"escaped" # pre-processor cmds from within a macro definition would be
remarkably useful.

Something like:

#define frog "my"

#define APPEND_STRING( arg1, append )
\#redefine ###arg1 arg1 append

APPEND_STRING( frog, " dog" )

would (magically) expand to:

#redefine frog "my" " dog"

1. This is very rough and sketchy and I take no account for the order and
timing of macro expansion so don't pick it apart on that basis, its *just*
an outline of a pre-processor feature that I have wanted for mm.. around 10
2. Obviously, there is no "#redefine" but a little bit of shuffling around
with #undefs and a temporary define would do the same thing.

The command #redefine would be rather useful - header files are *littered*
with #undef blah, #define blah's.

Just some outlandish ideas :-)


Q-Games, Dylan Cuthbert.
"Paul Mensonides" <pmenso57_at_[hidden]> wrote in message
> > Will any of this kind of stuff ever filter into the stl or standard
> > (iso 4?)  The whole style of C++ programming would change for the
> > It would also help people get on with optimizing gcc's compile times if
> > was more in use ;-)
> >
> > Now, if only there were better meta-programming support in the
> > :-) the ability to define macros within other macros would do it.  Not
> > I like using macros but sometimes they *are* the only solution.
> >
> > Regards
> What do you need exactly from the preprocessor?
> Paul Mensonides
> _______________________________________________
> Unsubscribe & other changes:

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