so in this example it used this syntax A::operator+(B)
and on this code CVector CVector::operator+ (const CVector& param)
it's pretty obvious that B would be the "param" but i don't get where is A
or how does CVector becomes A...
I hope someone explain this to me cause I'm really confused here.. I really don't get it..
if you use member function syntax, it looks like: <Class operator belongs to (left hand side)>::operator+(<class you are adding (right hand side)>)
In that case A + B is the same as A.operator+(B)
However it is way better to declare every operator aside from assigment as freestanding functions. X operator+(A lhs, B rhs)