- : this. . , operator+() , , , this.
, -, , , , (operator+() ), -, (operator+=() , ).
, . operator+() operator+=(), - -= ..
, , , const .
, operator+ :
class Person
{
public:
Person& operator+=(const Person& i)
{
return *this;
}
};
inline Person operator+(Person lhs, const Person& rhs)
{
lhs += rhs;
return lhs;
}
. , , : . , , , , . . , .
, , +, . , ? ( , , , . :))
, Person , . ( , , .)