Skip to content

Commit dd5c738

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#2196 from CaseyCarter/patch-3
Update move-constructors-and-move-assignment-operators-cpp.md
2 parents 5b6c390 + 0854d15 commit dd5c738

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/cpp/move-constructors-and-move-assignment-operators-cpp.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ The following example shows the complete move constructor and move assignment op
167167
168168
```cpp
169169
// Move constructor.
170-
MemoryBlock(MemoryBlock&& other)
170+
MemoryBlock(MemoryBlock&& other) noexcept
171171
: _data(nullptr)
172172
, _length(0)
173173
{
@@ -186,7 +186,7 @@ MemoryBlock(MemoryBlock&& other)
186186
}
187187
188188
// Move assignment operator.
189-
MemoryBlock& operator=(MemoryBlock&& other)
189+
MemoryBlock& operator=(MemoryBlock&& other) noexcept
190190
{
191191
std::cout << "In operator=(MemoryBlock&&). length = "
192192
<< other._length << "." << std::endl;
@@ -292,15 +292,15 @@ If you provide both a move constructor and a move assignment operator for your c
292292

293293
```cpp
294294
// Move constructor.
295-
MemoryBlock(MemoryBlock&& other)
295+
MemoryBlock(MemoryBlock&& other) noexcept
296296
: _data(nullptr)
297297
, _length(0)
298298
{
299299
*this = std::move(other);
300300
}
301301
```
302302
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.
304304
305305
## See also
306306

0 commit comments

Comments
 (0)