3 ms·
I don't have any trouble with pointers. I can understand C programs just fine. But Modern C++, as the evangelists love to point out, is specifically about avoid
by holmak 10y ago
I don't have any trouble with pointers. I can understand C programs just fine. But Modern C++, as the evangelists love to point out, is specifically about avoiding raw pointers in favor of smart pointers, value semantics, etc. That's the stuff that I find difficult to use.
I did buy Stroustrup's post-C++11 book, "A Tour of C++", which is supposed to be the compact "how to do Modern C++". It provides tips, but as I mentioned above, I did not find it comprehensive enough. Terse recommendations like "Prefer returning by value" may be great small-scale recommendations, but they don't explain how the big picture is supposed to come together.
- lossolo 10y agoYou should watch those cppcon again, because Stroustrup and Herb are saying there many times that smart pointers are NOT should be use instead of raw pointers. Use smart pointers where It's about ownership. You should watch this video: https://www.youtube.com/watch?v=1OEu9C51K2A https://www.youtube.com/watch?v=1OEu9C51K2A