c++ - Compound assignment operator overloading -
i have seen boost give possibility of doing:
v*=c c i.e. double , v vector
how make, exercise, overloading of *= correctly, works in same way of previous example (with double on right side)?
how this?
// in class t& operator *= (double d) { member *= d; return *this; } // outside of class t operator * (t v, double d) { v *= d; return v; }
Comments
Post a Comment