The Happy Path to Modern C++ (C++11 done!)

I’ve finally found time and motivation to resume work on the “Happy Path to Modern C++” project. I’m sure it now contains enough code snippets to give you a good overview of C++11. As a matter of fact, I can’t think of an easier way to learn C++11, provided you’re already well-versed in C++ and C++98, in particular.

Here’s the project on GitHub.

“Dèyè mòn, gen mòn”, as the Haitians say: “Behind mountains there are more mountains”. The next goal is adding plenty of C++14 snippets. Again, contributions are highly appreciated!

Comments (2)

  1. 18:44, 01-03-2020Greg  / Reply

    Hi

    good stuff, one comment:
    are you sure that this is C++11:
    shared_ptr pia1{new int[100]{11, 22, 33}};
    Because I am not (does not compile with compiler what not support c++17 headers)

    https://stackoverflow.com/questions/13061979/shared-ptr-to-an-array-should-it-be-used

  2. 19:26, 01-03-2020Ralf  / Reply

    Hi Greg, thanks for pointing this out! This syntax is valid in C++11 for unique_ptr, but not for shared_ptr. Strangely, it compiles fine with g++ 7.4.0, even with options ‘-std=c++11 -pedantic’.

Leave a Reply