cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
overload=
overload=
Sep 25, 2009 at 8:19pm UTC
maros522
(25)
Hello all,
why function for overload operator= must be function of class, it can't be a friend function?
Thank you.
Sep 25, 2009 at 8:47pm UTC
Duthomhas
(13212)
See answer number 2 here
http://stackoverflow.com/questions/871264/what-does-operator-must-be-a-non-static-member-mean-c
Sep 25, 2009 at 8:48pm UTC
Bazzy
(6281)
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
Sep 28, 2009 at 8:34am UTC
maros522
(25)
Thank all.
Topic archived. No new replies allowed.