tmp/tmp2zpbjcv4/{from.md → to.md}
RENAMED
|
@@ -6,15 +6,28 @@ header `<memory>`.
|
|
| 6 |
Unless otherwise specified, if an exception is thrown in the following
|
| 7 |
algorithms, objects constructed by a placement *new-expression*
|
| 8 |
[[expr.new]] are destroyed in an unspecified order before allowing the
|
| 9 |
exception to propagate.
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
Some algorithms specified in [[specialized.algorithms]] make use of the
|
| 12 |
-
exposition-only function
|
| 13 |
|
| 14 |
``` cpp
|
| 15 |
template<class T>
|
| 16 |
constexpr void* voidify(T& obj) noexcept {
|
| 17 |
return addressof(obj);
|
| 18 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
```
|
| 20 |
|
|
|
|
| 6 |
Unless otherwise specified, if an exception is thrown in the following
|
| 7 |
algorithms, objects constructed by a placement *new-expression*
|
| 8 |
[[expr.new]] are destroyed in an unspecified order before allowing the
|
| 9 |
exception to propagate.
|
| 10 |
|
| 11 |
+
[*Note 1*: When new objects are created by the algorithms specified in
|
| 12 |
+
[[specialized.algorithms]], the lifetime ends for any existing objects
|
| 13 |
+
(including potentially-overlapping subobjects [[intro.object]]) in
|
| 14 |
+
storage that is reused [[basic.life]]. — *end note*]
|
| 15 |
+
|
| 16 |
Some algorithms specified in [[specialized.algorithms]] make use of the
|
| 17 |
+
following exposition-only function templates:
|
| 18 |
|
| 19 |
``` cpp
|
| 20 |
template<class T>
|
| 21 |
constexpr void* voidify(T& obj) noexcept {
|
| 22 |
return addressof(obj);
|
| 23 |
}
|
| 24 |
+
|
| 25 |
+
template<class I>
|
| 26 |
+
decltype(auto) deref-move(I& it) {
|
| 27 |
+
if constexpr (is_lvalue_reference_v<decltype(*it)>)
|
| 28 |
+
return std::move(*it);
|
| 29 |
+
else
|
| 30 |
+
return *it;
|
| 31 |
+
}
|
| 32 |
```
|
| 33 |
|