Denis Koroskin wrote:
On Sun, 22 Feb 2009 14:02:53 +0300, Mattias Holm <[email protected]> wrote:

I think that the following would work reasonably well:

allow the [] operator for arrays to take comma separated lists of indices.

So the OpenCL like statement:

    v.xyzw = v2.wzyx;

will be written as:

    v[0,1,2,3] = v2[3,2,1,0];

How would you implement it for user-defined types?

T[] opIndex(int[] indices) { ... }
void opIndexAssign(int[] indices, T[] values) { ... }

Reply via email to