3 ms·
This is basically how I program C++. Except that I try to avoid the 'new' keyword too by std::make_unique and std::make_shared. This way there are literally zer
by Kenji 9y ago
This is basically how I program C++. Except that I try to avoid the 'new' keyword too by std::make_unique and std::make_shared. This way there are literally zero 'new' and 'delete' or 'malloc' or 'free' calls in your program.
- ape4 9y agoLikewise, I avoid -> if possible.
- saagarjha 9y agoLike, the operator ->? Why, and what do you use instead?
- beached_whale 9y agoI would try to go further and wrap them in a class to hide the heap usage and expose the valid uses in the interface. Then it reads like a value and walks like one too. Unless I need virtual inheritance I guess.