File tree 1 file changed +4
-4
lines changed 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ The following example shows the complete move constructor and move assignment op
167
167
168
168
```cpp
169
169
// Move constructor.
170
- MemoryBlock(MemoryBlock&& other)
170
+ MemoryBlock(MemoryBlock&& other) noexcept
171
171
: _data(nullptr)
172
172
, _length(0)
173
173
{
@@ -186,7 +186,7 @@ MemoryBlock(MemoryBlock&& other)
186
186
}
187
187
188
188
// Move assignment operator.
189
- MemoryBlock& operator=(MemoryBlock&& other)
189
+ MemoryBlock& operator=(MemoryBlock&& other) noexcept
190
190
{
191
191
std::cout << "In operator=(MemoryBlock&&). length = "
192
192
<< other._length << "." << std::endl;
@@ -292,15 +292,15 @@ If you provide both a move constructor and a move assignment operator for your c
292
292
293
293
``` cpp
294
294
// Move constructor.
295
- MemoryBlock (MemoryBlock&& other)
295
+ MemoryBlock (MemoryBlock&& other) noexcept
296
296
: _ data(nullptr)
297
297
, _ length(0)
298
298
{
299
299
* this = std::move(other);
300
300
}
301
301
```
302
302
303
- The [std::move](../standard-library/utility-functions.md#move) function preserves the rvalue property of the *other* parameter .
303
+ The [std::move](../standard-library/utility-functions.md#move) function converts the lvalue `other` to an rvalue .
304
304
305
305
## See also
306
306
You can’t perform that action at this time.
0 commit comments