3 ms·
C++ RAII is completely gone without the use of classes; it requires something with a destructor.
by kazinator 7y ago
C++ RAII is completely gone without the use of classes; it requires something with a destructor.
- vnorilo 7y agoI guess the OP means pod types (plain Cish structs) where dtors are implicit.
- AnimalMuppet 7y agoBut 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".
- vnorilo 7y agoPresuming 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.
- deleted 7y ago[deleted]