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

Reply via email to