D plan to do RAII(Resource Acquisition Is Initialization)?

weaselcat via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 21 02:45:21 PST 2015


On Saturday, 21 February 2015 at 10:06:26 UTC, FrankLike wrote:
> RAII(Resource Acquisition Is Initialization) is a good 
> thing,will D plan to do it?

RAII in D is handled by structs.
It becomes a bit tricky when you want class semantics with RAII, 
but can be handled by wrapping the class in a struct I suppose. 
The unique and refcounted implementations would help with this, 
but they are lacking.


More information about the Digitalmars-d mailing list