Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #13961

Re: The or operator and the preprocessor?

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c++
Subject Re: The or operator and the preprocessor?
Date Mon, 13 Feb 2012 20:27:07 +1300
Lines 27
Message-ID <9prsabF2i6U2@mid.individual.net> (permalink)
References <jh9ra0$2h3$1@speranza.aioe.org> <9prck4F2i6U1@mid.individual.net> <jha79h$mlb$1@speranza.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net vSlQmKqalFv2nzANL4qOzA/usesq6gA/43MH1oJ3v69ZkKDD/x
Cancel-Lock sha1:iZtO1jy6YhgS99jWkeDwTBf2wn8=
User-Agent Mozilla/5.0 (X11; SunOS i86pc; rv:6.0.2) Gecko/20111003 Thunderbird/6.0.2
In-Reply-To <jha79h$mlb$1@speranza.aioe.org>
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:13961

Show key headers only | View raw


On 02/13/12 06:32 PM, glen herrmannsfeldt wrote:
> Ian Collins<ian-news@hotmail.com>  wrote:
>
> (snip, I wrote)
>
>>> error: "or" cannot be used as a macro name as it is an operator in C++
>
> (snip)
>
>> The error is valid, "or" is the alternative token for "||" in C++.
>
> Oh, so also valid in preprocessor statements?
>
> So might cause problems similar to:
>
> #define x define
>
> #x y 1
>
>> Redefining it is a bad idea.
>
> Well, that is probably true of all the language keywords.

"or" is an operator, not a keyword.

-- 
Ian Collins

Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

The or operator and the preprocessor? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-02-13 02:08 +0000
  Re: The or operator and the preprocessor? Ian Collins <ian-news@hotmail.com> - 2012-02-13 15:59 +1300
    Re: The or operator and the preprocessor? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-02-13 05:32 +0000
      Re: The or operator and the preprocessor? Ian Collins <ian-news@hotmail.com> - 2012-02-13 20:27 +1300

csiph-web