Small Vectors Proposal
Walter Bright
newshound at digitalmars.com
Tue Jan 30 18:35:02 PST 2007
Andrei Alexandrescu (See Website For Email) wrote:
> Walter Bright wrote:
>> Thank you, this is in line with what I thought you meant. I'm glad I
>> was right. Your proposal is sensible and well thought out.
>>
>> The only improvement I'd make is instead of:
>>
>> float4 f;
>>
>> Have:
>>
>> float[4] f;
>>
>> i.e. make static arrays of 2,3,4 dimensions have the suggested
>> properties. I think this is quite doable.
>
> I don't think this is advisable. It practically introduces an arbitrary
> discontinuity. Think of a template of T and N that manipulates arrays
> T[N]. All of a sudden, for certain values of T and N, arrays started
> being passed around by value.
I agree that it's a very bad idea to have such a discontinuity in ref vs
value. Static arrays would have to be all by value or all by ref. Then,
you'll just see slower speed for the larger ones.
More information about the Digitalmars-d
mailing list