On Fri, 23 Sep 2011 16:09:31 +0300, so <[email protected]> wrote:

It was there to show how it should be used in user code, and testing.
Swizzle is not just a rvalue operation, there is also a lvalue part to it which plays a bit differently (hence, swizzleR and swizzleL). We could take care of it with an overload but D doesn't act quite like what i expected (like C++), i don't understand why it won't differentiate "fun()" from "fun() const".

Sorry about the nonsense.
It is now with opDispatch (attached)
To make a generic "swizzle" function we need to introduce a few traits but
if all you want is a support for T[N] that is easy.

Attachment: test.d
Description: Binary data

Reply via email to