News for hackers. Stuff that matters.
Re:Why I Write Games in C (yes, C) by kazinator on Saturday September 21, 2019 @04:00PM (#21037574)
C++ RAII is completely gone without the use of classes; it requires something with a destructor.
Re:Why I Write Games in C (yes, C) by vnorilo on Saturday September 21, 2019 @11:06PM (#21039381)
I guess the OP means pod types (plain Cish structs) where dtors are implicit.
Re:Why I Write Games in C (yes, C) by AnimalMuppet on Sunday September 22, 2019 @12:17AM (#21039644)
But then what's left of RAII? What resource is there to allocate other than the memory itself? RAII means more than just "get memory to put this in".
Re:Why I Write Games in C (yes, C) by vnorilo on Sunday September 22, 2019 @12:44AM (#21039715)
Presuming GP includes unique_ptr, there's no real loss of RAII. In my opinion you might as well write trivial classes, but hey, to each his own.