Hi,
A typical use of the C preprocessor is to use object-like macros as flags
for controlling code expansion:
#if defined(OBJECT_LIKE_MACRO)
EXPANDED_IF_DEFINED
#else
EXPANDED_IF_NOT_DEFINED
#endif
The OBJECT_LIKE_MACRO is usually defined either in some configuration
header, or it
- Original Message -
From: David Abrahams [EMAIL PROTECTED]
Vesa Karvonen [EMAIL PROTECTED] writes:
I'd like to propose adding suitable predicate macros, in particular
BOOST_PP_IS_EMPTY(X), BOOST_PP_IS_1(X), BOOST_PP_IS_EMPTY_OR_1(X),
I like them (and I like the implementations)!
- Original Message -
From: Vesa Karvonen [EMAIL PROTECTED]
Vesa, I hack this up so it works on all compilers and then add it to the
CVS. The main problem is that the implementation relies on expansion order.
That is another name for VC and Metrowerks bugs. I don't see why they
can't be
- Original Message -
From: Paul Mensonides [EMAIL PROTECTED]
Vesa, I hack this up so it works on all compilers and then add it to the
CVS. The main problem is that the implementation relies on expansion
order.
That is another name for VC and Metrowerks bugs. I don't see why they
Paul Mensonides [EMAIL PROTECTED] writes:
Vesa, I can get it to work on VC and Metrowerks if I alter the semantics
slightly. Namely by doing this:
#define IS_ZERO(x) IS_ZERO_I( CHECK x () )
// ...
#define CHECK() 1
The semantic change is that 'x' must not be a function-like macro. What
Vesa Karvonen [EMAIL PROTECTED] writes:
David Abrahams:
Paul Mensonides:
The semantic change is that 'x' must not be a function-like macro. What do
you think?
I think that rules out most of the use-cases Vesa was interested in
addressing with this :(
Well, it does rule out some
- Original Message -
From: David Abrahams [EMAIL PROTECTED]
Well, it does rule out some use-cases, and it is not ideal to have such
limitations, but it should
still be useful for testing whether an object-like macro, such as an
include guard, or a config
macro, has been defined. I
- Original Message -
From: Vesa Karvonen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, January 05, 2003 3:45 PM
Subject: Re: [boost] Boost.Preprocessor: Alternatives to defined(x)
David Abrahams:
Paul Mensonides:
The semantic change is that 'x' must not be a function
- Original Message -
From: Paul Mensonides [EMAIL PROTECTED]
Anyway, I might still be able to make the original ideal work with VC and
Metrowerks. (You wouldn't believe how sick I am of those two compilers!)
Give me some time
Actually it is not possible anyway. Not necessarily