Template class with dispatched properties

Ross Hays throwaway at email.net
Thu Nov 7 19:35:31 PST 2013


Awesome that seems to do what I was going for. I had tried a 
similar approach with @property dispatch and the subtraction of 
'x', but I had left out the static if and had the opDispatch 
returning a ref of the entry in the array (so there would just be 
the one @property still) but that resulted in "Error: no property 
'x' for type 'test.Vector!(2, float).Vector'".

This is interesting, though probably not a very safe way to 
handle vectors in the real world (even more so if they are going 
to be vectors of more than length 3).


More information about the Digitalmars-d-learn mailing list