The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
I was quite delighted to discover among the alternate operator tokens keywords for &&, || and !. I never really liked these "rude" logical operators and this gave me a sufficient incentive to switch to the nicer litteral representation.
Isn't that beautiful ?
if (i < N and not Odd(A[i]))
I will not embrace the tokens for &, | and ~, as these correspond to bitwise operators which are more arithmetic in essence and compare to the usual +, -, *, /. Even less the _eq forms, which in my opinion are misnomers: f.i. or_eq should read bitor_eq.
The comma operator; result = a , b; computes a, discards it, computes b, and assigns b to result.
C++ (and C)'s hidden operator language; Conditional operator result = a ? b : c; evaluates a, then evaluates b if a is nonzero, or else evaluates c. The comma operator above as a way to do sequences as an expression. All C++ is missing is a value-returning loop.
I do second the motion for method pointers as the most obscure and underused (but useful) aspect of C++.
Or maybe virtual multiple inheritance, which can get mind-bendingly complex in examples I've seen in the wild.
I've tried my hand at redefining the comma operator[^] after I've seen it in Blitz++ and Boost::Spirit (!). But I eventually discarded the idea due to various problems.
I tried metaprogramming (the factorial implementation), but only for instructional purposes, not for real use.
What I actually use in real code:
1. I do overload ++ and -- (pre and postfix both) a lot.
2. I did use in-place new and explicit call of destructor for the implementation of a memory pool. I don't see anything wrong with that as there really is no other good way to allocate memory for C++ objects and ensure proper initialization. (and cleaning up after release, without freeing the memory)
3. I do use static methods occasionally. But I wonder why they are on the "obscure features list" to start with.
Of the remaining features listed in that article, I would indeed consider them obscure as I either wasn't aware them, or never found a useful application. Passing a function as a template parameter is the only feature of these that I would consider useful, although I haven't actually used it myself.
If you want an equally or more obscure feature, the only thing I can think of from the top of my head are trigraphs. (see http://www.gotw.ca/gotw/086.htm[^] - it also contains examples for some items already on the list)