Skip to content

Commit 4f1e06a

Browse files
chore: QOL changes to assign5 readme
1 parent 1ddd17e commit 4f1e06a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

assign5/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ With the help of your `operator<<`, your coworkers have been able to make good p
7474
7575
To be specific, you will need to:
7676
77-
1. Implement a destructor for the `User` class. To do so, implement the `User::~User()` SMF.
78-
2. Make the `User` class copy constructible. To do so, implement the `User::User(const User& user)` SMF.
79-
3. Make the `User` class copy assignable. To do so, implement the `User& User::operator=(const User& user)` SMF.
80-
4. Prevent the `User` class from being move constructed. To do so, delete the `User::User(User&& user)` SMF.
81-
5. Prevent the `User` class from being move assigned. To do so, delete the `User& User::operator=(User&& user)` SMF.
77+
1. Implement a destructor for the `User` class. To do so, implement the `~User()` SMF.
78+
2. Make the `User` class copy constructible. To do so, implement the `User(const User& user)` SMF.
79+
3. Make the `User` class copy assignable. To do so, implement the `User& operator=(const User& user)` SMF.
80+
4. Prevent the `User` class from being move constructed. To do so, delete the `User(User&& user)` SMF.
81+
5. Prevent the `User` class from being move assigned. To do so, delete the `User& operator=(User&& user)` SMF.
8282
8383
In performing these tasks, you are expected to make changes to **both** the `user.h` and `user.cpp` files.
8484
@@ -109,6 +109,8 @@ std::cout << charlie << std::endl;
109109
// User(name=Charlie, friends=[Alice])
110110
```
111111
112+
The function signature for this operator should be `User& operator+=(const User& rhs)`. Note that like the copy-assignment operator, it returns a reference to itself.
113+
112114
### `operator<`
113115
114116
Recall that the `<` operator is required to store users in a `std::set`, as `std::set` is implemented in terms of the comparison operator. Implement `operator<` to compare users alphabetically by name. For example:
@@ -126,6 +128,7 @@ else
126128
// Alice is less than Charlie
127129
```
128130
131+
The function signature for this operator should be `bool operator<(const User& rhs)`.
129132
130133
## 🚀 Submission Instructions
131134

0 commit comments

Comments
 (0)