3 ms·
I love destructors and RAII. They're more elegant than "with" constructs and much safer (unless you have a fancy type system that warns you when you create a r
by dkarl 16y ago
I love destructors and RAII. They're more elegant than "with" constructs and much safer (unless you have a fancy type system that warns you when you create a resource object outside a "with.") They're the only thing about C++ that I really miss in other languages.
- sjs 16y agoIf anyone else who doesn't know C++ is curious about RAII (Resource Acquisition Is Initialization), the C2 wiki article was enlightening: http://c2.com/cgi/wiki?ResourceAcquisitionIsInitialization http://c2.com/cgi/wiki?ResourceAcquisitionIsInitialization Keep this in mind (from the wiki article): One problem with the name Resource Acquisition Is Initialization is that it is inaccurate: it's not always about resources, and it is nothing to do with initialization -- what makes the idiom tick is finalization.