2 ms·
Yes, it is RAII and RAII is fully implemented in D.
by WalterBright 4y ago
Yes, it is RAII and RAII is fully implemented in D.
- alphaglosined 4y agoBut only for structs. We really need to get actual reference counting into the language to cover classes properly as well. It has been on my todo list to write a DIP for this for a while now. ~rikki.
- ntrel 4y agoClass instances can go on the stack too using `scope`: scope obj = new Object; ... // destroyed at end of scope