An Issue I Wish To Raise Awareness On

Moritz Maxeiner via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 21 12:17:51 PDT 2017


On Friday, 21 July 2017 at 11:57:11 UTC, Kagamin wrote:
> On Friday, 21 July 2017 at 08:51:27 UTC, Atila Neves wrote:
>> Mutexes and sockets are classes, so not destroyed 
>> deterministically.
>
> They should, like any unmanaged resources

I tend to agree, although

> e.g. by wrapping in a smart pointer.

objects that manage their own lifetime limit the design space 
unnecessarily.
It's better to use normal structs to wrap resources (RAII) and 
then build whatever object lifetime management scheme one wants 
(including reference counting) on top of that.


More information about the Digitalmars-d mailing list