|
![](/i/fill.gif) |
On Sun, 21 Sep 2008 20:02:00 +0200, Orchid XP v8 <voi### [at] dev null> wrote:
> According to the tutorial, "if your compiler does not support this, it
> is not a standards-compliant C++ compiler".
There is currently as far as I know only one C++ compiler vendor that even
claims to implement the full standard.
> I keep trying to sort out in my head which combination of symbols mean
> bitwise operations and which ones mean logical operations.
The bitwise operators are all single character. There are also only four
of them. You get used to it.
> Using names makes the difference clear. (To me anyway.)
> Of course, none of this helps with trying to read other people's code.
Which is why it would be better in the long run to simply get used to the
symbols.
> (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.)
The bitwise operators in C & C++ only work on integers. However, there are
a few silent conversions to 'int' to be aware of.
> 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>
I hope you do not think GCC is standards-compliant by default either.
--
FE
Post a reply to this message
|
![](/i/fill.gif) |