tmp/tmphk9bvdrx/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### General <a id="expected.un.general">[[expected.un.general]]</a>
|
| 2 |
+
|
| 3 |
+
Subclause [[expected.unexpected]] describes the class template
|
| 4 |
+
`unexpected` that represents unexpected objects stored in `expected`
|
| 5 |
+
objects.
|
| 6 |
+
|
| 7 |
+
``` cpp
|
| 8 |
+
namespace std {
|
| 9 |
+
template<class E>
|
| 10 |
+
class unexpected {
|
| 11 |
+
public:
|
| 12 |
+
// [expected.un.cons], constructors
|
| 13 |
+
constexpr unexpected(const unexpected&) = default;
|
| 14 |
+
constexpr unexpected(unexpected&&) = default;
|
| 15 |
+
template<class Err = E>
|
| 16 |
+
constexpr explicit unexpected(Err&&);
|
| 17 |
+
template<class... Args>
|
| 18 |
+
constexpr explicit unexpected(in_place_t, Args&&...);
|
| 19 |
+
template<class U, class... Args>
|
| 20 |
+
constexpr explicit unexpected(in_place_t, initializer_list<U>, Args&&...);
|
| 21 |
+
|
| 22 |
+
constexpr unexpected& operator=(const unexpected&) = default;
|
| 23 |
+
constexpr unexpected& operator=(unexpected&&) = default;
|
| 24 |
+
|
| 25 |
+
constexpr const E& error() const & noexcept;
|
| 26 |
+
constexpr E& error() & noexcept;
|
| 27 |
+
constexpr const E&& error() const && noexcept;
|
| 28 |
+
constexpr E&& error() && noexcept;
|
| 29 |
+
|
| 30 |
+
constexpr void swap(unexpected& other) noexcept(see below);
|
| 31 |
+
|
| 32 |
+
template<class E2>
|
| 33 |
+
friend constexpr bool operator==(const unexpected&, const unexpected<E2>&);
|
| 34 |
+
|
| 35 |
+
friend constexpr void swap(unexpected& x, unexpected& y) noexcept(noexcept(x.swap(y)));
|
| 36 |
+
|
| 37 |
+
private:
|
| 38 |
+
E unex; // exposition only
|
| 39 |
+
};
|
| 40 |
+
|
| 41 |
+
template<class E> unexpected(E) -> unexpected<E>;
|
| 42 |
+
}
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
A program that instantiates the definition of `unexpected` for a
|
| 46 |
+
non-object type, an array type, a specialization of `unexpected`, or a
|
| 47 |
+
cv-qualified type is ill-formed.
|
| 48 |
+
|