[boost] Re: [Fun] (( a xor b )) formal review request...

2003-08-21 Thread Fernando Cacciola
Daniel Frey wrote:
> Paul Mensonides wrote:
>>> #define xor )?BOOST_DETAIL_XOR(
>>
>> FYI, you cannot legally define "xor" because it is specifically *not* an
>> identifier--even to the preprocessor.  This is the primary difference
>> between "keywords" and textual "alternative tokens."
>
> I admit that I forgot that 'xor' is an alternative token (which should
> better be called bitxor, but anyway).
>
> But according to the Boost guidelines, my macro has to be called
> BOOST_XOR anyway ("boostification"). Or how about alternatives like
> 'eor', 'lxor', 'logicxor', you-name-it...?
>
Good idea :-)

I'd use 'BOOST_LXOR'.
I'd implement it as:

#define BOOST_DETAIL_LXOR(x) !(x) : !!(x)

which would work with classes without bool/safe_bool conversion but with operator!.

Fernando Cacciola





___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


[boost] Re: [Fun] (( a xor b )) formal review request...

2003-08-20 Thread Daniel Frey
Paul Mensonides wrote:
#define xor )?BOOST_DETAIL_XOR(
FYI, you cannot legally define "xor" because it is specifically *not* an
identifier--even to the preprocessor.  This is the primary difference
between "keywords" and textual "alternative tokens."
I admit that I forgot that 'xor' is an alternative token (which should 
better be called bitxor, but anyway).

But according to the Boost guidelines, my macro has to be called 
BOOST_XOR anyway ("boostification"). Or how about alternatives like 
'eor', 'lxor', 'logicxor', you-name-it...?

Regards, Daniel

--
Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: [EMAIL PROTECTED], web: http://www.aixigo.de
___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost