On tor, 2008-09-11 at 10:03 -0600, Alex Rousskov wrote: > You made the right choice. The "modifying methods modify their object" > approach is more efficient and should be expected by most C++ > developers.
Yes, the other approach (return a new object) is used mainly for operators. C = A + B; Methods that operate like operators is mostly confusing and needs to be learnt one by one.. Personally I prefer functions over methods for such use.. C = append(a, b) Note: append is a bad example as the + operator is a very good semantic match.. mostly interesting when there is no good operator to use. Regards Henrik
