|
|
|
|
|
by rmeby
1208 days ago
|
|
I would imagine operator overloading helps with vectors so you can do things like: public static Vector operator -(Vector a, Vector b)
{
Vector v = new Vector();
v.X = a.X - b.X;
v.Y = a.Y - b.Y;
return v;
}
So then you can just write: Vector result = myVector1 - myVector2;
|
|
At one point Mozilla had a prototype implementation of strongly-typed value types in JavaScript, but it fell by the wayside once WebAssembly became a thing.