News for hackers. Stuff that matters.
Re:Obscure C++ Features by voyou on Wednesday December 11, 2013 @03:44AM (#6886616)
Are these really that obscure? Well, the 3[array] thing is unexpected and also not something you would use in real code, so it reasonably counts as obscure (although it's such a hoary example of "obscure C" that it's almost familiar). But pointers-to-members, template-template parameters, and the overloads of ++ and -- are, I would have thought, just standard features you would learn in the normal course of learning the language.
Re:Obscure C++ Features by 10098 on Wednesday December 11, 2013 @04:17AM (#6886703)
Yeah, out of all these only the "most vexing parse" struck me as somewhat obscure simply because it's so insidious. The rest... not really that obscure. I mean, come on. a[3] equivalent of *(a+3)? That's just pointer arithmetic. Most of the other stuff is probably intermediate level.
Re:Obscure C++ Features by Jare on Wednesday December 11, 2013 @06:14AM (#6887023)
Most people understand that a[3] and *(a + 3) yield the same result, not that they are actually identical in terms of language syntax.
Re:Obscure C++ Features by the_af on Wednesday December 11, 2013 @11:15AM (#6888362)
They are trivially not identical in terms of syntax: one uses ( and the other [. Surely you mean in terms of what operation they both represent?
Re:Obscure C++ Features by jheriko on Wednesday December 11, 2013 @07:40AM (#6887327)
they really aren't identical in the general case - this is a mistake on the part of the author. trivially consider the case where i overload operator[]...
Re:Obscure C++ Features by CJefferson on Wednesday December 11, 2013 @08:23AM (#6887481)
Yes, this is more of an obscure C feature (they are exactly the same in all cases in C, the standard defines a[b] as *(a+b)), which is inherited by C++.
Re:Obscure C++ Features by EpicEng on Wednesday December 11, 2013 @04:13AM (#6886693)
I thought that the reference qualifiers on member functions and perhaps the function try/catch blocks were fairly obscure, but yeah, not really anything else.
Re:Obscure C++ Features by k00pa on Wednesday December 11, 2013 @05:47AM (#6886939)
I think its obscure for the people used to use scrtipting-languages.
Re:Obscure C++ Features by eXpl0it3r on Wednesday December 11, 2013 @04:55AM (#6886799)
Obscurity can be view from a rather personal perspective. What might seem obscure for one person can be totally normal for another person (e.g. some rituals in some cults).

Though I agree that some of the given examples should be clear by reading a good C++ book, which is one of the main issue with learning C++, most of the books aren't really good enough.

Re:Obscure C++ Features by ccoggins on Wednesday December 11, 2013 @12:32PM (#6889042)
Any good ones that you recommend? Is Stroustup's new version of the C++PL worth reading through or is that more of a reference book?