c++ - Should I use "&&" or "and"? -


i'm using c++11 , both compiling without warning, witch 1 best way it?

if(a && b) 

or

if(a , b) 

2.6 alternative tokens [lex.digraph]

1 alternative token representations provided operators , punctuators.16

2 in respects of language, each alternative token behaves same, respectively, primary token, except spelling.17 set of alternative tokens defined in table 2.

can't paste table 2, explicitly states alternative: and, primary && (same or , ||).

so absolutely identical. if want try , convince 1 "better" other, that's business. if else trying argue such, they'd better have reason.

edit: aforementioned table 2:

table 2 — alternative tokens alternative primary <%          { %>          } <:          [ :>          ] %:          # %:%:        ## ,         && bitor       | or          || xor         ˆ compl       ~ bitand      & and_eq      &= or_eq       |= xor_eq      ˆ= not         ! not_eq      != 

edit: maybe worth noting, according sebastian redl, ms break rules here.


Comments