3 ms·
D does support RAII. But RAII has a problem: If you want transactions A and B to be both successful, or both are unwound, using RAII is a clumsy technique. It g
by WalterBright 4y ago
D does support RAII. But RAII has a problem: If you want transactions A and B to be both successful, or both are unwound, using RAII is a clumsy technique. It gets much worse if you need A, B and C to either all succeed or all fail. This article goes into detail:
https://dlang.org/articles/exception-safe.html https://dlang.org/articles/exception-safe.html