glibc 2.1.1pre2 breaks libstdc++-v3 build
Nathan Myers
ncm@nospam.cantrip.org
Fri Jan 12 01:30:00 GMT 2001
On Thu, Jan 11, 2001 at 02:03:40PM -0800, Ulrich Drepper wrote:
> "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
> > As I mentioned in my last message, you can capture the definition of a
> > macro inside an inline function:
>
> No, you cannot. A macro definition can vary in different compilation
> runs.
I hate to disagree with Ulrich, but ... yes you can. Note that he
said "inline". The different compilation runs would get different
definitions of the inline function -- technically "undefined behavior",
but we, as the implementor, can define the behavior.
What can't be captured in an inline function is non-standard
hyper-extended gcc macros that expand differently depending on
their use context (e.g. arguments). If you know something about
the macros' definitions you can often get the same (or better)
results with template specializations, but we're not talking
about such cases here.
Nathan Myers
ncm at cantrip dot org
More information about the Libstdc++
mailing list