B
bluekite2000
In one of the books, the author writes:
Class Complex
{
....
Complex& operator+=(const Complex& Other)
{
real_+=Other.real_;
im_+=Other.im_;
return *this;
}
....
}
Why cant it just be
void operator+=(const Complex& Other)
{
real_+=Other.real_;
im_+=Other.im_;
}
Class Complex
{
....
Complex& operator+=(const Complex& Other)
{
real_+=Other.real_;
im_+=Other.im_;
return *this;
}
....
}
Why cant it just be
void operator+=(const Complex& Other)
{
real_+=Other.real_;
im_+=Other.im_;
}