Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork130
Commit76fa259
committed
Make String move constructor move instead of copy.
The move constructor String::String(String&&) and String::operator=(String&&)now perform move instead of copy.Remove String(StringSumHelper&&) constructor because having it makes no sense:String(String&&) takes care of it - you can pass either String&& orStringSumHelper&& to this constructor. StringSumHelper is derived from Stringand has no data members other than those inherited from String. Even if it didhave some extra data members, truncation would have to happen during move, andnormally that is something you don't want.1 parent5f37ba4 commit76fa259
2 files changed
+18
-43
lines changedLines changed: 18 additions & 35 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
49 | 48 |
| |
| 49 | + | |
| 50 | + | |
| 51 | + | |
50 | 52 |
| |
51 |
| - | |
52 |
| - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 |
| |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 | 57 |
| |
61 | 58 |
| |
62 | 59 |
| |
| |||
191 | 188 |
| |
192 | 189 |
| |
193 | 190 |
| |
194 |
| - | |
195 | 191 |
| |
196 | 192 |
| |
197 |
| - | |
198 |
| - | |
199 |
| - | |
200 |
| - | |
201 |
| - | |
202 |
| - | |
203 |
| - | |
204 |
| - | |
205 |
| - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
206 | 204 |
| |
207 |
| - | |
208 |
| - | |
209 |
| - | |
210 |
| - | |
211 |
| - | |
212 |
| - | |
213 | 205 |
| |
214 |
| - | |
215 | 206 |
| |
216 | 207 |
| |
217 | 208 |
| |
| |||
223 | 214 |
| |
224 | 215 |
| |
225 | 216 |
| |
226 |
| - | |
227 | 217 |
| |
228 | 218 |
| |
229 |
| - | |
230 |
| - | |
231 |
| - | |
232 |
| - | |
233 |
| - | |
234 |
| - | |
235 |
| - | |
| 219 | + | |
236 | 220 |
| |
237 | 221 |
| |
238 |
| - | |
239 | 222 |
| |
240 | 223 |
| |
241 | 224 |
| |
|
Lines changed: 0 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
66 |
| - | |
67 | 66 |
| |
68 |
| - | |
69 |
| - | |
70 | 67 |
| |
71 | 68 |
| |
72 | 69 |
| |
| |||
90 | 87 |
| |
91 | 88 |
| |
92 | 89 |
| |
93 |
| - | |
94 | 90 |
| |
95 |
| - | |
96 |
| - | |
97 | 91 |
| |
98 | 92 |
| |
99 | 93 |
| |
| |||
223 | 217 |
| |
224 | 218 |
| |
225 | 219 |
| |
226 |
| - | |
227 | 220 |
| |
228 |
| - | |
229 | 221 |
| |
230 | 222 |
| |
231 | 223 |
| |
|
0 commit comments
Comments
(0)