Just a quickie to get a feel for the community in general's preference: When working with objects like Vectors (mathematical, not STL) and Matrices do you prefer a library that:
A) Doesn't alter the objects but returns copies instead:
Vec2 Vec2::Add(float x, float y) {
return Vec2(this.x + x, this.y + y);
}
B) Alters the objects and returns references:
Vec2& Vec2::Add(float x, float y) {
this.x += x;
this.y += y;
return (*this);
}
I can see some pros and cons to both, but the big thing for me is that method B would be more efficient.
So, opinions?