C++17

rsw0x via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 26 12:52:50 PST 2016


On Tuesday, 26 January 2016 at 20:43:06 UTC, Chris Wright wrote:
> On Tue, 26 Jan 2016 20:22:19 +0000, rsw0x wrote:
>
>> On Tuesday, 26 January 2016 at 20:05:16 UTC, deadalnix wrote:
>>> On the other hand, D's type system can be leveraged to reduce 
>>> lock contention on the GC (and not lock at all on thread 
>>> local allocs).
>> 
>> There's no such thing in D.
>> 
>> shared int* i = new int(5);
>> int* l = new int(5);
>> 
>> these call the same exact functions with the same exact typeid.
>
> Which means that the checks regarding shared are performed at 
> compile time and not at runtime. That's perfectly valid.
>
> The type system is also mostly expressed at compile time -- 
> there's no runtime check inserted at the start of each method 
> ensuring that each of its class-based parameters is in fact of 
> the required type. That's not a problem.

Yes, and what he said is not currently possible in D because 
there's no way to know if an allocation is shared or not implying 
that the language *does* need changes.


More information about the Digitalmars-d mailing list