Small vector and matrix proposed for phobos2 now on github
#ponce
spam at spam.spam
Mon Apr 26 03:48:05 PDT 2010
I'm not sure how your static foreach is actually static.
I think static foreach is a very good idea to minimize speed difference between debug and release versions (i know one shouldn't ship debug version, but sometimes you have to)...
> //Single element access does not require opDispatch
> writeln(v.x);
>
> //Swizzling supported via opDispatch
> writeln(v.yzx); //2 3 1
> writeln(v.xxyyzx); //1 1 2 2 3 1
Can we get assignment through swizzle ? Like:
v.xy = vector2f(1.f, 2.f);
(but one should disallow:
v.xx = vector2f(1.f, 2.f); )
Also, I like the naming, even though I would probably alias it anyway.
Existing solutions: vector3f, vec3f, smallVector3f, float3...
More information about the Digitalmars-d-announce
mailing list