
24 Jan
2009
24 Jan
'09
10:44 a.m.
* Olex P
But you know it doesn't make too much sense because I also have to define addition Scalar + Vector (that means construct vector from scalar and add a vector), Vector + Scalar and so on. And as we are not able to overload operations in C++ like way we have to create several different operations even if their meaning is pretty close. Probably it's possible with ad hoc overloading but I don't know is it good idea.
Consider defining functions with meaningful names (like scalarPlusVector), you then can use them as infix operators: 5 `scalarPlusVector` Vector 1 2 3 -- Roman I. Cheplyaka :: http://ro-che.info/ "Don't let school get in the way of your education." - Mark Twain