Vector2 Add (const Vector2& other) const
{
return Vector2(x+ other.x, y+ other.y);
}
If the function is const meaning that it promises not to transform the class, why do we then return that type but can still add stuff to it? I’m genuinely confused by this. Need some clarity, thanks.
New contributor
BeardlessDev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.