forked from TartanLlama/expected
Docs
This commit is contained in:
+86
-30
@@ -336,43 +336,31 @@ public:
|
||||
|
||||
void <a href='doc_expected.html#tl::expected-T,E-'>swap</a>(<a href='doc_expected.html#tl::expected-T,E-'>expected</a>& rhs) noexcept(std::is_nothrow_move_constructible<T>::value&&noexcept(swap(std::declval<T&>(), std::declval<T&>()))&&std::is_nothrow_move_constructible<E>::value&&noexcept(swap(std::declval<E&>(), std::declval<E&>())));
|
||||
|
||||
constexpr const T* <a href='doc_expected.html#tl::expected-T,E-'>operator-></a>() const;
|
||||
constexpr const T* <a href='doc_expected.html#tl::expected-T,E-::operator--()const'>operator-></a>() const;
|
||||
T* <a href='doc_expected.html#tl::expected-T,E-::operator--()const'>operator-></a>();
|
||||
|
||||
T* <a href='doc_expected.html#tl::expected-T,E-'>operator-></a>();
|
||||
constexpr const T& <a href='doc_expected.html#tl::expected-T,E-::operator*()const&'>operator*</a>() const &;
|
||||
T& <a href='doc_expected.html#tl::expected-T,E-::operator*()const&'>operator*</a>() &;
|
||||
constexpr const T&& <a href='doc_expected.html#tl::expected-T,E-::operator*()const&'>operator*</a>() const &&;
|
||||
T&& <a href='doc_expected.html#tl::expected-T,E-::operator*()const&'>operator*</a>() &&;
|
||||
|
||||
constexpr const T& <a href='doc_expected.html#tl::expected-T,E-'>operator*</a>() const &;
|
||||
constexpr bool <a href='doc_expected.html#tl::expected-T,E-::has_value()const'>has_value</a>() const noexcept;
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-::has_value()const'>operator bool</a>() const noexcept;
|
||||
|
||||
T& <a href='doc_expected.html#tl::expected-T,E-'>operator*</a>() &;
|
||||
constexpr const T& <a href='doc_expected.html#tl::expected-T,E-::value()const&'>value</a>() const &;
|
||||
T& <a href='doc_expected.html#tl::expected-T,E-::value()const&'>value</a>() &;
|
||||
constexpr const T&& <a href='doc_expected.html#tl::expected-T,E-::value()const&'>value</a>() const &&;
|
||||
T&& <a href='doc_expected.html#tl::expected-T,E-::value()const&'>value</a>() &&;
|
||||
|
||||
constexpr const T&& <a href='doc_expected.html#tl::expected-T,E-'>operator*</a>() const &&;
|
||||
|
||||
T&& <a href='doc_expected.html#tl::expected-T,E-'>operator*</a>() &&;
|
||||
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>operator bool</a>() const noexcept;
|
||||
|
||||
constexpr bool <a href='doc_expected.html#tl::expected-T,E-'>has_value</a>() const noexcept;
|
||||
|
||||
constexpr const T& <a href='doc_expected.html#tl::expected-T,E-'>value</a>() const &;
|
||||
|
||||
T& <a href='doc_expected.html#tl::expected-T,E-'>value</a>() &;
|
||||
|
||||
constexpr const T&& <a href='doc_expected.html#tl::expected-T,E-'>value</a>() const &&;
|
||||
|
||||
T&& <a href='doc_expected.html#tl::expected-T,E-'>value</a>() &&;
|
||||
|
||||
constexpr const E& <a href='doc_expected.html#tl::expected-T,E-'>error</a>() const &;
|
||||
|
||||
E& <a href='doc_expected.html#tl::expected-T,E-'>error</a>() &;
|
||||
|
||||
constexpr const E&& <a href='doc_expected.html#tl::expected-T,E-'>error</a>() const &&;
|
||||
|
||||
E&& <a href='doc_expected.html#tl::expected-T,E-'>error</a>() &&;
|
||||
constexpr const E& <a href='doc_expected.html#tl::expected-T,E-::error()const&'>error</a>() const &;
|
||||
E& <a href='doc_expected.html#tl::expected-T,E-::error()const&'>error</a>() &;
|
||||
constexpr const E&& <a href='doc_expected.html#tl::expected-T,E-::error()const&'>error</a>() const &&;
|
||||
E&& <a href='doc_expected.html#tl::expected-T,E-::error()const&'>error</a>() &&;
|
||||
|
||||
template <class U>
|
||||
constexpr T <a href='doc_expected.html#tl::expected-T,E-'>value_or</a>(U&& v) const &;
|
||||
|
||||
constexpr T <a href='doc_expected.html#tl::expected-T,E-::value_or(U&&)const&'>value_or</a>(U&& v) const &;
|
||||
template <class U>
|
||||
T <a href='doc_expected.html#tl::expected-T,E-'>value_or</a>(U&& v) &&;
|
||||
T <a href='doc_expected.html#tl::expected-T,E-::value_or(U&&)const&'>value_or</a>(U&& v) &&;
|
||||
};</code></pre>
|
||||
|
||||
An `expected<T, E>` object is an object that contains the storage for another object and manages the lifetime of this contained object `T`. Alternatively it could contain the storage for another unexpected object `E`. The contained object may not be initialized after the expected object has been initialized, and may not be destroyed before the expected object has been destroyed. The initialization state of the contained object is tracked by the expected object.
|
||||
@@ -438,6 +426,74 @@ Calls `f` if the expectd is in the unexpected state
|
||||
|
||||
(2) EXPLICIT constexpr expected(unexpected<G> &&e);</code></pre>
|
||||
|
||||
### Operator `tl::expected::operator->`<a id="tl::expected-T,E-::operator--()const"></a>
|
||||
|
||||
<pre><code class="language-cpp">(1) constexpr const T* operator->() const;
|
||||
|
||||
(2) T* operator->();</code></pre>
|
||||
|
||||
*Returns*: a pointer to the stored value
|
||||
|
||||
*Requires*: a value is stored
|
||||
|
||||
### Operator `tl::expected::operator*`<a id="tl::expected-T,E-::operator*()const&"></a>
|
||||
|
||||
<pre><code class="language-cpp">(1) constexpr const T& operator*() const &;
|
||||
|
||||
(2) T& operator*() &;
|
||||
|
||||
(3) constexpr const T&& operator*() const &&;
|
||||
|
||||
(4) T&& operator*() &&;</code></pre>
|
||||
|
||||
*Returns*: the stored value
|
||||
|
||||
*Requires*: a value is stored
|
||||
|
||||
### Function `tl::expected::has_value`<a id="tl::expected-T,E-::has_value()const"></a>
|
||||
|
||||
<pre><code class="language-cpp">(1) constexpr bool has_value() const noexcept;
|
||||
|
||||
(2) constexpr operator bool() const noexcept;</code></pre>
|
||||
|
||||
*Returns*: whether or not the optional has a value
|
||||
|
||||
### Function `tl::expected::value`<a id="tl::expected-T,E-::value()const&"></a>
|
||||
|
||||
<pre><code class="language-cpp">(1) constexpr const T& value() const &;
|
||||
|
||||
(2) T& value() &;
|
||||
|
||||
(3) constexpr const T&& value() const &&;
|
||||
|
||||
(4) T&& value() &&;</code></pre>
|
||||
|
||||
*Returns*: the contained value if there is one, otherwise throws \[bad\_expected\_access\]
|
||||
|
||||
### Function `tl::expected::error`<a id="tl::expected-T,E-::error()const&"></a>
|
||||
|
||||
<pre><code class="language-cpp">(1) constexpr const E& error() const &;
|
||||
|
||||
(2) E& error() &;
|
||||
|
||||
(3) constexpr const E&& error() const &&;
|
||||
|
||||
(4) E&& error() &&;</code></pre>
|
||||
|
||||
*Returns*: the unexpected value
|
||||
|
||||
*Requires*: there is an unexpected value
|
||||
|
||||
### Function template `tl::expected::value_or`<a id="tl::expected-T,E-::value_or(U&&)const&"></a>
|
||||
|
||||
<pre><code class="language-cpp">(1) template <class U>
|
||||
constexpr T value_or(U&& v) const &;
|
||||
|
||||
(2) template <class U>
|
||||
T value_or(U&& v) &&;</code></pre>
|
||||
|
||||
*Returns*: the stored value if there is one, otherwise returns `u`
|
||||
|
||||
-----
|
||||
|
||||
-----
|
||||
|
||||
Reference in New Issue
Block a user