3 ms·
Since D has scope guards - any plans to add deterministic destructors? i.e. RAII a la C++.
by zerr 7y ago
Since D has scope guards - any plans to add deterministic destructors? i.e. RAII a la C++.
- destructionator 7y agoThey've been there... I think since the beginning. If not since the beginning for at last ten years now.
- mhh__ 7y agoAlready there. P.S. click the link to see the spec...
- qznc 7y agoStruct destructors are always deterministic: https://dlang.org/spec/struct.html#struct-destructor https://dlang.org/spec/struct.html#struct-destructor Class destructors can be declared deterministic with the "scope" keyword: https://dlang.org/spec/attribute.html#scope https://dlang.org/spec/attribute.html#scope Scope guards are useful if you cannot change the data type itself.