Commit 14e923e
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&& or
StringSumHelper&& to this constructor. StringSumHelper is derived from String
and has no data members other than those inherited from String. Even if it did
have some extra data members, truncation would have to happen during move, and
normally that is something you don't want.1 parent e2d2f20 commit 14e923e
2 files changed
+18
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | | - | |
70 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 75 | | |
79 | 76 | | |
80 | 77 | | |
| |||
214 | 211 | | |
215 | 212 | | |
216 | 213 | | |
217 | | - | |
218 | 214 | | |
219 | 215 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
230 | 227 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | 228 | | |
238 | | - | |
239 | 229 | | |
240 | 230 | | |
241 | 231 | | |
| |||
247 | 237 | | |
248 | 238 | | |
249 | 239 | | |
250 | | - | |
251 | 240 | | |
252 | 241 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
| 242 | + | |
260 | 243 | | |
261 | 244 | | |
262 | | - | |
263 | 245 | | |
264 | 246 | | |
265 | 247 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | 75 | | |
77 | | - | |
78 | | - | |
79 | 76 | | |
80 | 77 | | |
81 | 78 | | |
| |||
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
102 | | - | |
103 | 99 | | |
104 | | - | |
105 | | - | |
106 | 100 | | |
107 | 101 | | |
108 | 102 | | |
| |||
233 | 227 | | |
234 | 228 | | |
235 | 229 | | |
236 | | - | |
237 | 230 | | |
238 | | - | |
239 | 231 | | |
240 | 232 | | |
241 | 233 | | |
| |||
0 commit comments