Fact checking for my talk

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 13 09:28:57 PDT 2016


On Saturday, 13 August 2016 at 13:02:09 UTC, Liam McSherry wrote:
> On Saturday, 13 August 2016 at 12:47:40 UTC, Ethan Watson wrote:
>>
>>                              |  Rust   |  Swift  |    C#   |
>> -----------------------------|---------+---------+---------|
>>     Template Constraints     |    Y    |    Y    |  where  | 
>> [1]
>> -----------------------------|---------+---------+---------|
>>   Template "if" Constraints  |  where  |  where  |  where  |
>> -----------------------------|---------+---------+---------|
>>         static if            |    N    |    N    |    N    |
>> -----------------------------|---------+---------+---------|
>
> It might be something to note that C# doesn't have templates.

Not true. C# use generic (aka type erasure) for objects, but use 
template for value types. C# doesn't make the difference at the 
language level, but that is obvious from the fact that there is 
no way to do generic for value types.

C# even does virtual dispatch on them, by storing a hashmap in 
the vtable and looking up implementation from typeinfos.



More information about the Digitalmars-d mailing list