4 ms·
C++ is a vast language. If you look at the sheer variety of topics in something like Stroustrups books, there a fair chance any one project doesn't require most
by lordnacho 8y ago
C++ is a vast language. If you look at the sheer variety of topics in something like Stroustrups books, there a fair chance any one project doesn't require most of them. Variadic templates, metaprogramming, memory barriers, the specifics of memory layout, public vs private inheritance... How often do you use all of these? Yet if you look at a few projects you'll often come across new things.
It's a good idea to look through one of these books (Stroustrup, Meyers, Alexandrescu, Antony Williams) just to index the topics in your mind.
Then there's the standard library, worth playing with a few data structures to get used to it. Possibly Boost as well though IMO a lot of the good stuff went into the STL.
- basilgohar 8y agoWhile I agree that most of your listed examples are likely esoteric enough to escape need in most projects, I am curious to know why public vs private inheritance was amongst them, being that it is a core feature of nearly all object-oriented programming languages.
- dpark 8y ago> I am curious to know why public vs private inheritance was amongst them, being that it is a core feature of nearly all object-oriented programming languages. Private inheritance is not "a core feature of nearly all object-oriented programming languages". C# doesn't support this, nor does Java. I don't believe Python or Javascript support this in a first-class way either.
- lordnacho 8y agoI think in Python everything is "public". C# it's been a while, I think you're right though. If you came from either of these languages and read a c++ file, you'd eventually wonder why there's this extra keyword in the inheritance specifier.
- lordnacho 8y agoIt's just one of those things that turns up in quizzes, what happens to the public/private/protected marked members when you change the inheritance level? Does it really matter a whole lot? Probably not. Luckily you will find the answer quite quickly if you search for it.