4 ms·
Can you tell the D compiler to free a pointer returned from a C method when it goes out of scope? Like uniq_ptr
by winrid 4y ago
Can you tell the D compiler to free a pointer returned from a C method when it goes out of scope? Like uniq_ptr
- boundchecked 4y agoD has scopeguards similar to defer.
- WalterBright 4y agoD can do RAII.
- germandiago 4y agovia structs, right? As for classes you should not rely on it I recall.
- pjmlp 4y agoYou can stack allocate classes, and then they behave like structs. https://dlang.org/blog/2017/07/07/go-your-own-way-part-one-the-stack/ https://dlang.org/blog/2017/07/07/go-your-own-way-part-one-t...