Made even more obscure by using dark grey on black.<p>I didn't know you could overload the comma operator that way. The comma operator was for use in C macros, for when multiple expressions were necessary. It should have been deprecated in C++.<p>The comma operator has different precedence inside and outside square brackets.<p><pre><code> tab(1,2)
</code></pre>
is a function call with two arguments.<p><pre><code> tab[1,2]
</code></pre>
is an invocation of the comma operator. You can't overload "operator[]" with multiple arguments and simulate multidimensional arrays.
Placement new isn't obscure or strange, it's in all those red books.<p>You may not use it, but you can appreciate it's very useful if you want that fine grained control that you're using c++ for in the first place.<p>Most of the other examples are just pure weirdness that you should never use. The kind you find in online employment exams.
These are features covered in every C++ book and if you don't know them you can hardly call yourself a C++ programmer.<p>Furthermore, the first 'C++ feature' is not even a feature. It is merely the result of the preprocessor translating a[b] to *(a+b). C has it too.
Am I the only one that just cringed reading the keyword replacement section? To me the example given seemed absolutely crazy. Can anyone validate this usage of the "feature"? It just seems so off.
>Accessing an element of an array via ptr[3] is actually just short for <i>(ptr + 3). This can be equivalently written as </i>(3 + ptr) and therefore as 3[ptr], which turns out to be completely valid code.<p>C++ standard defines the syntax of a postfix expression as this<p><pre><code> postfix-expression:
primary-expression
postfix-expression[expression]
postfix-expression[braced-init-list]
</code></pre>
[expression]primary-expression is not valid