mirror of
https://github.com/AnthonyCalandra/modern-cpp-features.git
synced 2025-12-17 01:54:36 +03:00
std::move typo
This commit is contained in:
2
CPP11.md
2
CPP11.md
@@ -559,7 +559,7 @@ Transferring `std::unique_ptr`s:
|
||||
```c++
|
||||
std::unique_ptr<int> p1{ new int };
|
||||
std::unique_ptr<int> p2 = p1; // error -- cannot copy unique pointers
|
||||
std::unique_ptr<int> p3 = std::move(p1); // move `p1` into `p2`
|
||||
std::unique_ptr<int> p3 = std::move(p1); // move `p1` into `p3`
|
||||
// now unsafe to dereference object held by `p1`
|
||||
```
|
||||
|
||||
|
||||
@@ -1151,7 +1151,7 @@ Transferring `std::unique_ptr`s:
|
||||
```c++
|
||||
std::unique_ptr<int> p1{ new int };
|
||||
std::unique_ptr<int> p2 = p1; // error -- cannot copy unique pointers
|
||||
std::unique_ptr<int> p3 = std::move(p1); // move `p1` into `p2`
|
||||
std::unique_ptr<int> p3 = std::move(p1); // move `p1` into `p3`
|
||||
// now unsafe to dereference object held by `p1`
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user