Boost logo

Boost :

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


Hi,

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
years.
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 :-)

Regards

--
---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com
"Paul Mensonides" <pmenso57_at_[hidden]> wrote in message
news:001d01c21caf$a6a3ea90$7772e50c_at_c161550a...
> > Will any of this kind of stuff ever filter into the stl or standard
libs?
> > (iso 4?)  The whole style of C++ programming would change for the
better.
> > It would also help people get on with optimizing gcc's compile times if
it
> > was more in use ;-)
> >
> > Now, if only there were better meta-programming support in the
pre-processor
> > :-) the ability to define macros within other macros would do it.  Not
that
> > 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:
http://lists.boost.org/mailman/listinfo.cgi/boost
>

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