News for hackers. Stuff that matters.
Re:C++17 is formally approved by doldge on Thursday September 07, 2017 @11:25AM (#15192704)
So I'd like to learn more about modern C++ and how to write it, but I'm not really sure where to begin. I've tried a couple of times, but coming from a C background, my code tends towards C styling with only the occasional use of C++ features.

Is anyone aware of a good tutorial or reference list for writing good modern C++ (C++11 or newer, I guess)?

Re:C++17 is formally approved by pveierland on Thursday September 07, 2017 @11:45AM (#15192896)
The following is a readable and modern FAQ which describes most language features: https://isocpp.org/faq

My preferred reference for the language and standard library: http://en.cppreference.com/w/

The following is a longer guide on modern C++ style: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC...

Re:C++17 is formally approved by Veratyr on Thursday September 07, 2017 @12:12PM (#15193156)
As a newcomer to C++ myself, I found Stanley Lippman's C++ primer to be helpful. The latest edition includes the newer features.

And in case it helps, the main things I find myself using differently to C are:

- Smart pointers. If you're not using them, use them. They're amazing. Seriously. Never have to worry about freeing something ever again.

- Object oriented design.

- Const reference arguments.

- The occasional auto.

Re:C++17 is formally approved by ChrisSD on Thursday September 07, 2017 @01:41PM (#15194076)
I'd second C++ Primer. It's a great overview of the language and has been updated for C++11. Unfortunately it was written too early for C++14 and beyond so if there is a newer edition planned (I've no idea) it might be worth the waiting. In any case C++11 was the big change for C++ so the fifth edition is still worth while.

One word of warning though, there's a confusing similarly titled book called "C++ Primer Plus" which you should avoid at all costs.

Re:C++17 is formally approved by twoodfin on Thursday September 07, 2017 @01:36PM (#15194034)
I'd add RAII to this list. Also, I find simple template functions to work as an incredibly powerful macro system.
Re:C++17 is formally approved by lorenzhs on Thursday September 07, 2017 @11:33AM (#15192781)
I really enjoyed "Efficient Modern C++". I'd describe it as a good overview of new features in C++11 and 14, how to use them, and how they fit together, but I'm not sure whether it makes for a good "C++ for C programmers" book.
Re:C++17 is formally approved by jaiprabhu on Thursday September 07, 2017 @07:45PM (#15196806)
Check out this recent post by Simon Brand on this subject - https://blog.tartanllama.xyz/learning-cpp/
Re:C++17 is formally approved by aurelian15 on Thursday September 07, 2017 @01:07PM (#15193768)
I really enjoyed "A Tour of C++" by Bjarne Stroustrup, which is a short book giving an overview of C++ features. It sticks to modern C++ practices from the very beginning.

Unfortunately, the book is C++11 only and correspondingly does not talk about C++14 or C++17.