I have a class cnVectorthat represents a point in three-dimensional space. Its + - * / operators are heavily used.
Their implementation is very short:
cnVector cnVector::operator + (const cnVector& v) const {
return cnVector(
x + v.x,
y + v.y,
z + v.z );
}
My question is that this function is very short, should it be built into it, although its intensive use? or will it generate too much code when using it?
source
share