DIP74 - where is at?

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 11 00:32:26 PDT 2015


On Sunday, 11 October 2015 at 07:01:35 UTC, Manu wrote:
> On 11 October 2015 at 15:57, deadalnix via Digitalmars-d 
> <digitalmars-d at puremagic.com> wrote:
>> On Sunday, 11 October 2015 at 05:52:45 UTC, Freddy wrote:
>>>
>>> On Saturday, 10 October 2015 at 23:25:49 UTC, Manu wrote:
>>>>
>>>> [...]
>>>
>>>
>>> Speaking of DIP74 can't we just wrap a class in a struct with 
>>> use reference counting with and use alias this?
>>
>>
>> You can. It is not safe, but it will do. Using type qualifier, 
>> one can get better than C++'s shared_ptr already.
>
> How?

In C++, you need to assume things are shared, and, as such, use 
thread safe inc/dec . That means compiler won't be able to 
optimize them. D can do better as sharedness is part of the type 
system.



More information about the Digitalmars-d mailing list