Document result<>::emplace

This commit is contained in:
Peter Dimov
2022-10-18 04:15:40 +03:00
parent 1e4c050d6c
commit ece71199a9

View File

@ -1659,6 +1659,11 @@ public:
constexpr E error() const;
// emplace
template<class... A>
constexpr T& emplace( A&&... a );
// swap
constexpr void swap( result& r );
@ -1854,6 +1859,20 @@ constexpr E error() const;
Effects: ::
If `*this` holds an error, returns it. Otherwise, returns `E()`.
#### emplace
```
template<class... A>
constexpr T& emplace( A&&... a );
```
[none]
* {blank}
+
Ensures: ::
`*this` holds the value `T( std::forward<A>(a)... )`.
Returns: ::
A reference to the contained value.
#### swap
```
@ -1962,6 +1981,10 @@ public:
constexpr E error() const;
// emplace
constexpr void emplace();
// swap
constexpr void swap( result& r );
@ -2105,6 +2128,17 @@ constexpr E error() const;
Effects: ::
If `*this` holds an error, returns it. Otherwise, returns `E()`.
#### emplace
```
constexpr void emplace();
```
[none]
* {blank}
+
Ensures: ::
`*this` holds an unspecified value.
#### swap
```