[OT] Unity migrating parts of their engine from C++ into High Performace C# (HPC#)

rumbu rumbu at rumbu.ro
Tue Apr 3 04:50:15 UTC 2018


On Monday, 2 April 2018 at 22:55:58 UTC, Meta wrote:
> On Monday, 2 April 2018 at 20:19:17 UTC, rumbu wrote:

>>
>> void foo<T>(IRange<T> someRange)
>> {
>>    //do something with someRange even it's a struct
>>    //this includes code completion and other IDE specific 
>> stuff.
>> }
>>
>>
>> In D, template constrains are not very clean and they not have 
>> IDE support:
>>
>> void foo(T)(T someRange) if (isInputRange!T)
>> {
>>
>> }
>
> Worth mentioning is that doing this necessarily causes the 
> struct to be boxed. I would not be surprised if they ban 
> structs inheriting from interfaces.

HPC# allows interface inheritance, but does not box structs. It's 
clearly stated in the video (15:30). In fact, boxing would bring 
up the GC, and GC is not allowed in HPC#.



More information about the Digitalmars-d mailing list