tmp/tmpti5eb5ra/{from.md → to.md}
RENAMED
|
@@ -9,13 +9,17 @@ ill-formed and uses-allocator construction will not pass an allocator to
|
|
| 9 |
|
| 10 |
**Change:** Different constraint on conversions from `unique_ptr`.
|
| 11 |
**Rationale:** Adding array support to `shared_ptr`, via the syntax
|
| 12 |
`shared_ptr<T[]>` and `shared_ptr<T[N]>`. **Effect on original
|
| 13 |
feature:** Valid C++14 code may fail to compile or may change meaning in
|
| 14 |
-
this revision of C++.
|
|
|
|
|
|
|
| 15 |
|
| 16 |
``` cpp
|
| 17 |
#include <memory>
|
| 18 |
std::unique_ptr<int[]> arr(new int[1]);
|
| 19 |
std::shared_ptr<int> ptr(std::move(arr)); // error: int(*)[] is not compatible with int*
|
| 20 |
```
|
| 21 |
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
**Change:** Different constraint on conversions from `unique_ptr`.
|
| 11 |
**Rationale:** Adding array support to `shared_ptr`, via the syntax
|
| 12 |
`shared_ptr<T[]>` and `shared_ptr<T[N]>`. **Effect on original
|
| 13 |
feature:** Valid C++14 code may fail to compile or may change meaning in
|
| 14 |
+
this revision of C++.
|
| 15 |
+
|
| 16 |
+
[*Example 1*:
|
| 17 |
|
| 18 |
``` cpp
|
| 19 |
#include <memory>
|
| 20 |
std::unique_ptr<int[]> arr(new int[1]);
|
| 21 |
std::shared_ptr<int> ptr(std::move(arr)); // error: int(*)[] is not compatible with int*
|
| 22 |
```
|
| 23 |
|
| 24 |
+
— *end example*]
|
| 25 |
+
|