|
![](/i/fill.gif) |
Fredrik Eriksson wrote:
> On Sun, 21 Sep 2008 18:28:44 +0200, Orchid XP v8 <voi### [at] dev null> wrote:
>> you can use the keywords "and", "or" and "not" in place of symbols.
>
> Don't. Not all compilers support this, and very few programmers are
> accustomed to it.
According to the tutorial, "if your compiler does not support this, it
is not a standards-compliant C++ compiler". (I'm only saying what the
tutorial says; I have no idea if that's correct or not.)
I keep trying to sort out in my head which combination of symbols mean
bitwise operations and which ones mean logical operations. Using names
makes the difference clear. (To me anyway.) Of course, none of this
helps with trying to read other people's code.
(Now Haskell also uses symbols for both. However, in Haskell, if you try
to perform logical operations on numbers, you get a type error, and vice
versa. Unfortunately C++ inherits C's braindead "hey, if you can
represent it as an unstructured bit pattern, it's an int, right?"
mentallity.)
>> However, Visual C++ doesn't seem to like it.
>
> This one in particular does not by default.
>
> You can make it support it by checking the option "Disable language
> extensions" which you probably should anyway.
Uh-huh. Yeah, I'll be doing that. I'd like to write code that will
compile everywhere. ;-)
Who'd have thought? An M$ product bending the standard slightly...
</sarcasm>
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
![](/i/fill.gif) |