overload=

Hello all,

why function for overload operator= must be function of class, it can't be a friend function?

Thank you.
From C++ standards:
An assignment operator shall be implemented by a non-static member function with exactly one parameter.
Because a copy assignment operator operator= is implicitly declared for a class if not declared by the
user
Thank all.
Topic archived. No new replies allowed.