perpetual: new module for mapping file into memory
Laeeth Isharc via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Wed Aug 19 01:08:47 PDT 2015
On Tuesday, 18 August 2015 at 14:32:18 UTC, Sergei Degtiarev
wrote:
> On Tuesday, 18 August 2015 at 06:52:47 UTC, Dmitry Olshansky
> wrote:
>> What I don't like is perpetual being a class - too bad as it
>> won't honor scoping and destructor may or may not be called.
>> Just make it a struct.
> Why do you think the destructor may not be called? It is, and
> it syncs memory and unmaps the file. Making perpetual a struct
> would require implementing reference counting or disabling
> copying, and all such staff. In my opinion, perpetual should
> definitely have reference semantics, this is exactly a point
> where D shines.
It might be run, but there is no guarantee a class destructor
will ever be called. A struct destructor will be when it goes
out of scope. Hence Scoped!
http://forum.dlang.org/thread/ikuomwcxhydluojkhjqy@forum.dlang.org
More information about the Digitalmars-d-announce
mailing list