Tuple literal syntax

Simen kjaeraas simen.kjaras at gmail.com
Thu Oct 7 08:22:08 PDT 2010


retard <re at tard.com.invalid> wrote:

>>> Why do tuple fields need a name?
>>
>> They don't always need, but oftentimes names are better than numeric
>> constants.
>
> If some compile time voodoo isn't used, the names have an effect on the
> performance (runtime lookups).

What? You really think structs/tuples are implemented like
Variant[string]?

foo.bar => *(&foo + bar.offsetof), where offsetof is known at
compiletime. It doesn't get faster than that.

-- 
Simen


More information about the Digitalmars-d mailing list