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


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

Re: The or operator and the preprocessor?

From glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups comp.lang.c++
Subject Re: The or operator and the preprocessor?
Date 2012-02-13 05:32 +0000
Organization Aioe.org NNTP Server
Message-ID <jha79h$mlb$1@speranza.aioe.org> (permalink)
References <jh9ra0$2h3$1@speranza.aioe.org> <9prck4F2i6U1@mid.individual.net>

Show all headers | View raw


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.
In most cases, though, it should't cause problems if you don't
use the keyword.

-- glen

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next 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