On 2012-06-30 10:56, Namespace wrote:
I have this class: http://dpaste.dzfl.pl/95990b4e
and would like that this call "Vector2s vec = Vector2s(42, 23);" returns
a new object and that this call "vec(44, 26)" set the x and y coords
from the existing object to 44 and 26.
Is that possible?
I try to c
I've tried different things and that here indeed compiles, but
does not work as it should/I want.
typeof(this) opCall(U, V)(U x, V y) if (__traits(compiles, {
this.x = 5; })) {
writeln("unstatic opCall");
this.Set(x, y);
return this;
}
static Vector2D!(T) opCall(U, V)
I have this class: http://dpaste.dzfl.pl/95990b4e
and would like that this call "Vector2s vec = Vector2s(42, 23);"
returns a new object and that this call "vec(44, 26)" set the x
and y coords from the existing object to 44 and 26.
Is that possible?
I try to check if the object is initialize wit