Live data from Hacker News

Obscure C++ Features

madebyevan.com

1–10 of 58 posts

Re: Obscure C++ Features

#8
The behavior of [] is from C -- it's not a bizarro C++ feature.

The "redefining keywords" is the pre-processor. That's what it does. There isn't anything magic here. Strictly speaking it can be run entirely ahead of the C/C++ compiler, on any file you want. There's no requirement that it is C/C++ - you could use it on a python script (as long as you weren't using # comments anywhere :D )

Re: Obscure C++ Features

#9
post #8

The behavior of [] is from C -- it's not a bizarro C++ feature. The "redefining keywords" is the pre-processor. That's what it does. There isn't anything magic here. Strictly speaking it can be run entirely ahead of the C/C++ compiler, on any file you want. There's no requirement that it is C/C++ - you could use it on a python script (as long as you weren't using # comments anywhere :D )

Definitions of obscure:

1. Not easily distinguished

2. Not readily understandable/expressable

3. Not commonly known

I didn't see the author use the word "bizarro" anywhere, nor make any claims about any of this stuff being weird. He actually presented almost everything in a fairly neutral tone, except when he said that using the preprocessor to override keywords was dangerous (which could be construed as opinion).

Post reply on HN