|
Re: copy constructors explanation and o.overloading
operator+() can be a member function of the class that accepts one argument, so "x = a + b" is effectively "x = a.operator+(b)" or a non-member, so "x = a + b" is effectively "x = operator+(a, b);".
The member function version can only accept one argument. The non-member version can only accept two.
The friend declaration within the class declares the non-member version as a friend of the class, which accepts two arguments. Removing the friend keyword makes the declaration into a member function, which is only allowed to accept one argument. However, your declaration has two .... hence the error.
The inline keyword is unrelated to your error.
|