2 ms·
> I would classify D's scope exit/failure/success as RAII actually, even if D uses a GC. It has better than that, but it is a bit clunky compared with C++(just
by gregdaniels421 2mo ago
> I would classify D's scope exit/failure/success as RAII actually, even if D uses a GC.
It has better than that, but it is a bit clunky compared with C++(just use struct instead of class). You can have proper destructors, but if you have a container you need to be more careful than in C++.
In D exceptions are the default like in C++ and you have to opt out with nothrow or extern(C) or betterC.
Really try some D code in a bigger situation it is 90% good and almost worth using over C++, but if you can't have GC it is a huge pain, but better than C.
- WalterBright 2mo agoI've never understood why GC would be a huge pain. It makes some things a lot easier, like Compile Time Function Execution. Also, recently the GC implementation received a big modernization upgrade.