Tuple literal syntax

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Oct 7 08:36:27 PDT 2010


On 10/7/10 10:22 CDT, Simen kjaeraas wrote:
> 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.
>

Yah, this is D dammit :o).

Andrei


More information about the Digitalmars-d mailing list