C++ Operator Overloading

The type of operator overloading that has some potential performance implications is one that returns an object of the type it operated on, usually binary operators. For example, operator+() is one of those operators. Consider the following code:

Vector3 velocity = oldVelocity + frameIncrement;
Vector3 propulsion = ComputePropulsion();
Vector3 finalVelocity = velocity + propulsion;

Continue reading “C++ Operator Overloading”