3 ms·
This "Rule of Zero" construct doesn't forgo RAII, since RAII does not simply mean "write constructors and destructors". Instead it allows the compiler and lang
by mpyne 14y ago
This "Rule of Zero" construct doesn't forgo RAII, since RAII does not simply mean "write constructors and destructors".
Instead it allows the compiler and language to automatically do the right thing to enable RAII by using appropriate library-provided building blocks. E.g. his std::unique_ptr + custom deleter type enables the compiler to automatically make a RAII-compliant class for the author, so it's still RAII, just automatically implemented (except for the ctor, in this case).