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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -