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

Baz via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 21 14:52:42 PST 2015


On Saturday, 21 February 2015 at 18:30:18 UTC, Olivier Pisano 
wrote:
> 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?
>
> It's already here :
>
>
> import std.stdio;
>
> struct Test
> {
>     ~this() { writeln("RAII"); }
> }
>
> void main()
> {
>      Test t; // prints "RAII" when goes out of scope
> }





More information about the Digitalmars-d mailing list