Major performance problem with std.array.front()

Adam D. Ruppe destructionator at gmail.com
Fri Mar 7 06:17:17 PST 2014


On Friday, 7 March 2014 at 14:04:53 UTC, Dicebot wrote:
> We don't need C ABI compatibility for stuff that is not 
> extern(C), do we?

That's a good point, though personally I'd still like some way to 
magic it up, even in extern(C).

Consider the example of library typedef. If C did:

typedef void* HANDLE;

and D did

struct HANDLE { void* foo; alias foo this; }

it is almost the same, but then when you declare

HANDLE OpenFile(...);

it won't work since the compiler will pass a hidden struct 
pointer (which is exactly what C woudl expect if it was a typedef 
struct { void* } on its side too) instead of expecting the value 
in the accumulator as it would with the void*.


More information about the Digitalmars-d mailing list