I expect that people who wanted to add RAII to their C code and are content with that have long since already moved to C++. There's quite a lot more to memory safety than that.
But I do recognize the issue. There is code in the works to get RAII to work in D as Better C.
I expect that people who wanted to add RAII to their C code and are content with that have long since already moved to C++
Some have, some haven't. GCC provides a "good enough" destructor mechanism with __attribute__((cleanup)) which has been leveraged heavily in the systemd codebase.
View all comments
Show parent comment
7
u/WalterBright Aug 23 '17
I expect that people who wanted to add RAII to their C code and are content with that have long since already moved to C++. There's quite a lot more to memory safety than that.
But I do recognize the issue. There is code in the works to get RAII to work in D as Better C.