News for hackers. Stuff that matters.
Re:Move, simply by slavik81 on Monday February 17, 2020 @05:24PM (#22351470)
I appreciate it's just an example, but it should be mentioned that this is a really bad class. If you write a custom destructor, you must also specify the move/copy constructors and move/assignment operators. Otherwise, the same data pointer will be deleted twice if the object is ever copied.
Re:Move, simply by gpu_explorer on Monday February 17, 2020 @06:45PM (#22352071)
Yes I know this of course but it seemed that leaving things out is faster and people can know it's just a toy.