Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can you tell the D compiler to free a pointer returned from a C method when it goes out of scope? Like uniq_ptr


D has scopeguards similar to defer.


D can do RAII.


via structs, right? As for classes you should not rely on it I recall.


You can stack allocate classes, and then they behave like structs.

https://dlang.org/blog/2017/07/07/go-your-own-way-part-one-t...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: