File tree Expand file tree Collapse file tree 1 file changed +20
-10
lines changed
Expand file tree Collapse file tree 1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -14,23 +14,33 @@ class User
1414 std::string get_name () const ;
1515 size_t size () const ;
1616 void set_friend (size_t index, const std::string& name);
17- friend std::ostream& operator <<(std::ostream& os, const User& u);
18-
19- /* *
17+ /* *
2018 * STUDENT TODO:
2119 * Your custom operators and special member functions will go here!
2220 */
23- ~User ();
21+ // friend function -> use public and private
22+ friend std::ostream& operator <<(std::ostream& os, const User& u);
23+ // Special Member Function
24+ // Destructor
25+ ~User ();
26+ // Copy Constructor
2427 User (const User& user);
25- User& User::operator =(const User& user);
26- User::User (User&& user) noexcept ;
27- User& User::operator =(User&& user) noexcept ;
28- User& User::operator +=(const User& user);
29- bool User::operator <(const User& user) const ;
28+ // Copy Assignment Operator
29+ User& operator =(const User& user);
30+ // Move Constructor
31+ User (User&& user) = delete ;
32+ // Move Assignment Operator
33+ User& operator =(User&& user) = delete ;
34+ // Object += Another object, Another Object += Object
35+ User& operator +=(User& user);
36+ // Object.size() (<,>,=) Another Object.size()
37+ bool operator <(const User& user) const ;
38+
39+ // Member element
3040
3141private:
3242 std::string _name;
3343 std::string* _friends;
3444 size_t _size;
3545 size_t _capacity;
36- };
46+ };
You can’t perform that action at this time.
0 commit comments