On Wed, Feb 19, 2014 at 8:55 PM, Father Chrysostomos <spr...@cpan.org> wrote: > Karl Williamson wrote: >> I did test the function on my machine by faking out the #ifdef's. But I >> was using g++, where 'and' is a synonym for &&. > > Same precedence? I'm curious. Are they copying Perl syntax? :-) >
In the header file iso646.h (on my system at least), which gives ANSI C those same C++ keywords: #ifndef __cplusplus #define and && #define and_eq &= #define bitand & #define bitor | #define compl ~ #define not ! #define not_eq != #define or || #define or_eq |= #define xor ^ #define xor_eq ^= #endif And wikipedia (http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#C.2B.2B_operator_synonyms) points out exactly how true that is even in C++ with this lovely example: 'int bitand ref' is exactly equivalent to 'int &ref'. If only they had copied Perl syntax! :-)