C++11

Started by
8 comments, last by bronxbomber92 12 years, 1 month ago
With both Clang and GCC having decent support for C++11, I'd like to start writing hobby projects in C++11. As far as I know, I don't believe there exists a published book on C++11, so I'm hoping to get from you all your favourites resources on the web where you've picked up C++11. I'm competent with C++03, so resources that assume prior C++03 experience are perfectly useful to me.

Thanks for your help!
Advertisement
Wikipedia. I just skim through the list until I find something that looks interesting and google that particular feature.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
Have a look at these videos from the Going Native 2012 conference: http://channel9.msdn...oingNative-2012

Also Washu writes in his journal about C++11 which IMO provides a nice overview about some of the new concepts.
http://www.gamedev.n...from-the-washu/

C++11 has some quite nice language features in, but as these are *language*-features it feels sometimes like learning a new language. I also find that it may take some time to find out what the best practices for using the features are. For example auto is great many times, but sometimes it can make the code harder to understand because it hides the type-information from the developer.
Scott Meyer's presentation slides are a pretty good resource, available for purchase as an ebook
[size="1"]
C++11? I can't say I have ever heard of it. My bad unsure.png

C++11? I can't say I have ever heard of it. My bad unsure.png

It's the new standard for the C++ language. It was known as C++0x for quite some time until the specs got ratified by ISO last year.
Oh ok, has it changed much?
What worked for the old (C++03) standard (probably) still works with the new standard. But a lot of things were "done right" and incorporated into the language itself instead of relying on template-libs like boost. It would be way too much to describe all the features here. The wikipedia-article that Cornstalks posted provides a good enough overview. Not all the stuff is already available in modern compilers, but quite a lot is already there. As I see it C++ took a giant step in evolving from "C-With-Classes" to it's own language.
Scott Meyer's presentation is probably the best single source of information I've found. It covers a lot of the features which are not currently supported by most (any?) compilers. The downside is of course that it's a presentation, so you miss some of the information.

STL (the person), does a fantastic job explaining the new features. He's been covering them as they've been added to Visual Studio. Starting with TR1:

http://blogs.msdn.com/b/vcblog/archive/2008/02/22/tr1-slide-decks.aspx

A few minor changes to the library, but for the most part ignore the std::tr1 namespace, use std instead and those slides apply as is. That will cover many of the new features of the standard library, but not all of them. He also covered the C++11 features as they were added into VS2010 (static_assert, decltype, auto, lambdas, rvalue references, nullptr):

http://blogs.msdn.com/b/vcblog/archive/2008/10/28/lambdas-auto-and-static-assert-c-0x-features-in-vc10-part-1.aspx
http://blogs.msdn.com/b/vcblog/archive/2009/02/03/rvalue-references-c-0x-features-in-vc10-part-2.aspx
http://channel9.msdn.com/Shows/Going+Deep/Stephan-T-Lavavej-Everything-you-ever-wanted-to-know-about-nullptr

That information is a bit dated, but I do mean a "bit". Everything you see there should still work for you, but a few of the tiny details have changed like implicit move, etc. Herb Sutter's Lambas, Lambdas, Everywhere is also a good talk:

http://channel9.msdn.com/Events/PDC/PDC10/FT13

As mentioned before, the Going Native 2012 conference is great, especially the variadic templates talk. Stick to Day 1 though, Day 2 doesn't cover anything actually in C++11.

In general, the list of C++11 support in Visual Studio is a good source too, since it provides links to the proposals for each feature if you need some more information:

http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx

And if you're lucky enough to come across a copy of n3290 or n3291, grab it. It's the official standard which is still selling for hundreds of dollars. Otherwise grab the latest draft and go off that.
-- gekko
Thanks for everyone's input. There is definitely a lot of material here, and I'm sure more than enough to get up to speed.

This topic is closed to new replies.

Advertisement