Comment by einpoklum
2 months ago
It's important to notice that you can keep well out of trouble by sticking to the rule of _zero_, i.e. relying on the defaults for copy&move ctors, assignment operators and destructor.
So, the best advice is: Don't mess with the razor blades. And these days, C++ gives you enough in the standard library to avoid messing with them yourself. But since this is C++, you _can_ always open up the safety casing and messing with things, if you really want to.
I'll admit, the Rule of Zero is the kind of thing I've been wanting all along, but so much code out there seems obsessed with micro-managing its pointer and reference semantics, and one still learns of their mistakes through segmentation faults and linker errors, at least in those codebases.
Also, an artist friend tells me you can make some pretty keen sculpture with razor blades and a spot welder. Still recommended to use pliers and gloves tho.