forked from TartanLlama/expected
Update docs
This commit is contained in:
278
docs/index.md
278
docs/index.md
@@ -1,144 +1,152 @@
|
||||
# Header file `expected.hpp`<a id="expected.hpp"></a>
|
||||
|
||||
<pre><code class="language-cpp">#define <a href='doc_expected.md#expected.hpp'>TL_EXPECTED_HPP</a>
|
||||
<pre><code class="language-cpp">#define <a href='doc_expected.html#expected.hpp'>TL_EXPECTED_HPP</a>
|
||||
|
||||
#define <a href='doc_expected.md#expected.hpp'>TL_EXPECTED_GCC49</a>
|
||||
#define <a href='doc_expected.html#expected.hpp'>TL_EXPECTED_GCC49</a>
|
||||
|
||||
#define <a href='doc_expected.md#expected.hpp'>TL_EXPECTED_NO_CONSTRR</a>
|
||||
#define <a href='doc_expected.html#expected.hpp'>IS_TRIVIALLY_COPY_CONSTRUCTIBLE</a>(T)
|
||||
|
||||
#define <a href='doc_expected.md#expected.hpp'>TL_EXPECTED_CXX14</a>
|
||||
#define <a href='doc_expected.html#expected.hpp'>IS_TRIVIALLY_COPY_ASSIGNABLE</a>(T)
|
||||
|
||||
#define <a href='doc_expected.md#expected.hpp'>TL_IN_PLACE_MONOSTATE_DEFINED</a>
|
||||
#define <a href='doc_expected.html#expected.hpp'>IS_TRIVIALLY_DESTRUCTIBLE</a>(T)
|
||||
|
||||
namespace <a href='doc_expected.md#expected.hpp'>tl</a>
|
||||
#define <a href='doc_expected.html#expected.hpp'>TL_EXPECTED_CXX14</a>
|
||||
|
||||
#define <a href='doc_expected.html#expected.hpp'>TL_MONOSTATE_INPLACE_MUTEX</a>
|
||||
|
||||
#define <a href='doc_expected.html#expected.hpp'>TL_TRAITS_MUTEX</a>
|
||||
|
||||
#define <a href='doc_expected.html#expected.hpp'>TL_OPTIONAL_EXPECTED_MUTEX</a>
|
||||
|
||||
namespace <a href='doc_expected.html#expected.hpp'>tl</a>
|
||||
{
|
||||
class <a href='doc_expected.md#tl::monostate'>monostate</a>;
|
||||
class <a href='doc_expected.html#tl::monostate'>monostate</a>;
|
||||
|
||||
struct <a href='doc_expected.md#tl::in_place_t'>in_place_t</a>;
|
||||
struct <a href='doc_expected.html#tl::in_place_t'>in_place_t</a>;
|
||||
|
||||
constexpr <a href='doc_expected.md#tl::in_place_t'>in_place_t{}</a> <a href='doc_expected.md#tl::in_place'>in_place</a>;
|
||||
constexpr <a href='doc_expected.html#tl::in_place_t'>in_place_t{}</a> <a href='doc_expected.html#tl::in_place'>in_place</a>;
|
||||
|
||||
template <class E>
|
||||
class <a href='doc_expected.md#tl::unexpected-E-'>unexpected</a>;
|
||||
class <a href='doc_expected.html#tl::unexpected-E-'>unexpected</a>;
|
||||
|
||||
template <class E>
|
||||
constexpr bool <a href='doc_expected.md#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator==</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator==</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
template <class E>
|
||||
constexpr bool <a href='doc_expected.md#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator!=</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator!=</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
template <class E>
|
||||
constexpr bool <a href='doc_expected.md#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator<</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator<</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
template <class E>
|
||||
constexpr bool <a href='doc_expected.md#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator<=</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator<=</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
template <class E>
|
||||
constexpr bool <a href='doc_expected.md#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator></a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator></a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
template <class E>
|
||||
constexpr bool <a href='doc_expected.md#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator>=</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#tl::operator==(constunexpected-E-&,constunexpected-E-&)'>operator>=</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
|
||||
template <class E>
|
||||
<a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a> <a href='doc_expected.md#tl::make_unexpected(E&&)'>make_unexpected</a>(E&& e);
|
||||
<a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a> <a href='doc_expected.html#tl::make_unexpected(E&&)'>make_unexpected</a>(E&& e);
|
||||
|
||||
struct <a href='doc_expected.md#tl::unexpect_t'>unexpect_t</a>;
|
||||
struct <a href='doc_expected.html#tl::unexpect_t'>unexpect_t</a>;
|
||||
|
||||
constexpr <a href='doc_expected.md#tl::unexpect_t'>unexpect_t{}</a> <a href='doc_expected.md#tl::unexpect'>unexpect</a>;
|
||||
constexpr <a href='doc_expected.html#tl::unexpect_t'>unexpect_t{}</a> <a href='doc_expected.html#tl::unexpect'>unexpect</a>;
|
||||
|
||||
template <class E>
|
||||
class <a href='doc_expected.md#expected.hpp'>bad_expected_access</a>;
|
||||
class <a href='doc_expected.html#expected.hpp'>bad_expected_access</a>;
|
||||
|
||||
template <class T, class E>
|
||||
class <a href='doc_expected.md#tl::expected-T,E-'>expected</a>;
|
||||
class <a href='doc_expected.html#tl::expected-T,E-'>expected</a>;
|
||||
|
||||
template <class T, class E, class U, class F>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator==</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.md#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator==</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.html#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
|
||||
template <class T, class E, class U, class F>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator!=</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.md#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator!=</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.html#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
|
||||
template <class T, class E, class U, class F>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator<</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.md#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator<</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.html#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
|
||||
template <class T, class E, class U, class F>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator></a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.md#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator></a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.html#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
|
||||
template <class T, class E, class U, class F>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator<=</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.md#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator<=</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.html#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
|
||||
template <class T, class E, class U, class F>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator>=</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.md#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator>=</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& lhs, const <a href='doc_expected.html#tl::expected-T,E-'>expected<U, F></a>& rhs);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator==</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator==</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator==</a>(const U& v, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator==</a>(const U& v, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator!=</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator!=</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator!=</a>(const U& v, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator!=</a>(const U& v, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator<</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator<</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator<</a>(const U& v, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator<</a>(const U& v, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator<=</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator<=</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator<=</a>(const U& v, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator<=</a>(const U& v, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator></a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator></a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator></a>(const U& v, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator></a>(const U& v, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator>=</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator>=</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const U& v);
|
||||
|
||||
template <class T, class E, class U>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator>=</a>(const U& v, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator>=</a>(const U& v, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator==</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator==</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator==</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator==</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator!=</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator!=</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator!=</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator!=</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator<</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator<</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator<</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator<</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator<=</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator<=</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator<=</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator<=</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator></a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator></a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator></a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator></a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator>=</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator>=</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e);
|
||||
|
||||
template <class T, class E>
|
||||
constexpr bool <a href='doc_expected.md#expected.hpp'>operator>=</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
constexpr bool <a href='doc_expected.html#expected.hpp'>operator>=</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& e, const <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& x);
|
||||
|
||||
template <class T, class E, 'hidden'>
|
||||
void <a href='doc_expected.md#expected.hpp'>swap</a>(<a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& lhs, <a href='doc_expected.md#tl::expected-T,E-'>expected<T, E></a>& rhs) noexcept(noexcept(lhs.swap(rhs)));
|
||||
void <a href='doc_expected.html#expected.hpp'>swap</a>(<a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& lhs, <a href='doc_expected.html#tl::expected-T,E-'>expected<T, E></a>& rhs) noexcept(noexcept(lhs.swap(rhs)));
|
||||
}</code></pre>
|
||||
|
||||
## Class `tl::monostate`<a id="tl::monostate"></a>
|
||||
@@ -153,14 +161,14 @@ Used to represent an expected with no data
|
||||
|
||||
<pre><code class="language-cpp">struct in_place_t
|
||||
{
|
||||
<a href='doc_expected.md#tl::in_place_t'>in_place_t</a>() = default;
|
||||
<a href='doc_expected.html#tl::in_place_t'>in_place_t</a>() = default;
|
||||
};</code></pre>
|
||||
|
||||
A tag type to tell expected to construct its value in-place
|
||||
|
||||
## Variable `tl::in_place`<a id="tl::in_place"></a>
|
||||
|
||||
<pre><code class="language-cpp">constexpr <a href='doc_expected.md#tl::in_place_t'>in_place_t{}</a> in_place;</code></pre>
|
||||
<pre><code class="language-cpp">constexpr <a href='doc_expected.html#tl::in_place_t'>in_place_t{}</a> in_place;</code></pre>
|
||||
|
||||
A tag to tell expected to construct its value in-place
|
||||
|
||||
@@ -170,15 +178,15 @@ A tag to tell expected to construct its value in-place
|
||||
class unexpected
|
||||
{
|
||||
public:
|
||||
<a href='doc_expected.md#tl::unexpected-E-'>unexpected</a>() = delete;
|
||||
<a href='doc_expected.html#tl::unexpected-E-'>unexpected</a>() = delete;
|
||||
|
||||
constexpr <a href='doc_expected.md#tl::unexpected-E-'>unexpected</a>(const E& e);
|
||||
constexpr <a href='doc_expected.html#tl::unexpected-E-'>unexpected</a>(const E& e);
|
||||
|
||||
constexpr <a href='doc_expected.md#tl::unexpected-E-'>unexpected</a>(E&& e);
|
||||
constexpr <a href='doc_expected.html#tl::unexpected-E-'>unexpected</a>(E&& e);
|
||||
|
||||
constexpr const E& <a href='doc_expected.md#tl::unexpected-E-::value()const&'>value</a>() const &;
|
||||
constexpr E& <a href='doc_expected.md#tl::unexpected-E-::value()const&'>value</a>() &;
|
||||
constexpr E&& <a href='doc_expected.md#tl::unexpected-E-::value()const&'>value</a>() &&;
|
||||
constexpr const E& <a href='doc_expected.html#tl::unexpected-E-::value()const&'>value</a>() const &;
|
||||
E& <a href='doc_expected.html#tl::unexpected-E-::value()const&'>value</a>() &;
|
||||
E&& <a href='doc_expected.html#tl::unexpected-E-::value()const&'>value</a>() &&;
|
||||
};</code></pre>
|
||||
|
||||
Used as a wrapper to store the unexpected value
|
||||
@@ -187,9 +195,9 @@ Used as a wrapper to store the unexpected value
|
||||
|
||||
<pre><code class="language-cpp">(1) constexpr const E& value() const &;
|
||||
|
||||
(2) constexpr E& value() &;
|
||||
(2) E& value() &;
|
||||
|
||||
(3) constexpr E&& value() &&;</code></pre>
|
||||
(3) E&& value() &&;</code></pre>
|
||||
|
||||
*Returns*: the contained value
|
||||
|
||||
@@ -198,22 +206,22 @@ Used as a wrapper to store the unexpected value
|
||||
## Comparison operator `tl::operator==`<a id="tl::operator==(constunexpected-E-&,constunexpected-E-&)"></a>
|
||||
|
||||
<pre><code class="language-cpp">(1) template <class E>
|
||||
constexpr bool operator==(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool operator==(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
|
||||
(2) template <class E>
|
||||
constexpr bool operator!=(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool operator!=(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
|
||||
(3) template <class E>
|
||||
constexpr bool operator<(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool operator<(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
|
||||
(4) template <class E>
|
||||
constexpr bool operator<=(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool operator<=(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
|
||||
(5) template <class E>
|
||||
constexpr bool operator>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
constexpr bool operator>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);
|
||||
|
||||
(6) template <class E>
|
||||
constexpr bool operator>=(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>& rhs);</code></pre>
|
||||
constexpr bool operator>=(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& lhs, const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>& rhs);</code></pre>
|
||||
|
||||
Compares two unexpected objects
|
||||
|
||||
@@ -222,7 +230,7 @@ Simply compares lhs.value() to rhs.value()
|
||||
## Function template `tl::make_unexpected`<a id="tl::make_unexpected(E&&)"></a>
|
||||
|
||||
<pre><code class="language-cpp">template <class E>
|
||||
<a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a> make_unexpected(E&& e);</code></pre>
|
||||
<a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a> make_unexpected(E&& e);</code></pre>
|
||||
|
||||
Create an `unexpected` from `e`, deducing the return type
|
||||
|
||||
@@ -232,14 +240,14 @@ Create an `unexpected` from `e`, deducing the return type
|
||||
|
||||
<pre><code class="language-cpp">struct unexpect_t
|
||||
{
|
||||
<a href='doc_expected.md#tl::unexpect_t'>unexpect_t</a>() = default;
|
||||
<a href='doc_expected.html#tl::unexpect_t'>unexpect_t</a>() = default;
|
||||
};</code></pre>
|
||||
|
||||
A tag type to tell expected to construct the unexpected value
|
||||
|
||||
## Variable `tl::unexpect`<a id="tl::unexpect"></a>
|
||||
|
||||
<pre><code class="language-cpp">constexpr <a href='doc_expected.md#tl::unexpect_t'>unexpect_t{}</a> unexpect;</code></pre>
|
||||
<pre><code class="language-cpp">constexpr <a href='doc_expected.html#tl::unexpect_t'>unexpect_t{}</a> unexpect;</code></pre>
|
||||
|
||||
A tag to tell expected to construct the unexpected value
|
||||
|
||||
@@ -249,112 +257,128 @@ A tag to tell expected to construct the unexpected value
|
||||
class expected
|
||||
{
|
||||
public:
|
||||
using <a href='doc_expected.md#tl::expected-T,E-'>value_type</a> = T;
|
||||
using <a href='doc_expected.html#tl::expected-T,E-'>value_type</a> = T;
|
||||
|
||||
using <a href='doc_expected.md#tl::expected-T,E-'>error_type</a> = E;
|
||||
using <a href='doc_expected.html#tl::expected-T,E-'>error_type</a> = E;
|
||||
|
||||
using <a href='doc_expected.md#tl::expected-T,E-'>unexpected_type</a> = <a href='doc_expected.md#tl::unexpected-E-'>unexpected<E></a>;
|
||||
using <a href='doc_expected.html#tl::expected-T,E-'>unexpected_type</a> = <a href='doc_expected.html#tl::unexpected-E-'>unexpected<E></a>;
|
||||
|
||||
template <class F>
|
||||
'hidden' <a href='doc_expected.md#tl::expected-T,E-::and_then(F&&)&'>and_then</a>(F&& f) &;
|
||||
'hidden' <a href='doc_expected.html#tl::expected-T,E-::and_then(F&&)&'>and_then</a>(F&& f) &;
|
||||
template <class F>
|
||||
constexpr auto and_then(F &&f) &&;
|
||||
template <class F>
|
||||
constexpr auto and_then(F &&f) const &;
|
||||
template <class F>
|
||||
constexpr auto and_then(F &&f) const &&;
|
||||
|
||||
template <class F> constexpr auto map(F &&f) &;
|
||||
template <class F> constexpr auto map(F &&f) &&;
|
||||
template <class F> constexpr auto map(F &&f) const &;
|
||||
template <class F> constexpr auto map(F &&f) const &&;
|
||||
|
||||
template <class F> constexpr auto map_error(F &&f) &;
|
||||
template <class F> constexpr auto map_error(F &&f) &&;
|
||||
template <class F> constexpr auto map_error(F &&f) const &;
|
||||
template <class F> constexpr auto map_error(F &&f) const &&;
|
||||
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>() = default;
|
||||
template <class F>
|
||||
<a href='doc_expected.html#tl::expected-T,E-'>expected</a> <a href='doc_expected.html#tl::expected-T,E-::or_else(F&&)&'>or_else</a>(F&& f) &;
|
||||
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected</a>& rhs) = default;
|
||||
template <class F>
|
||||
<a href='doc_expected.html#tl::expected-T,E-'>expected</a> <a href='doc_expected.html#tl::expected-T,E-'>or_else</a>(F&& f) &&;
|
||||
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>(<a href='doc_expected.md#tl::expected-T,E-'>expected</a>&& rhs) = default;
|
||||
template <class F>
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>expected</a> <a href='doc_expected.html#tl::expected-T,E-'>or_else</a>(F&& f) const &;
|
||||
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>& <a href='doc_expected.md#tl::expected-T,E-'>operator=</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected</a>& rhs) = default;
|
||||
template <class F>
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>expected</a> <a href='doc_expected.html#tl::expected-T,E-'>or_else</a>(F&& f) const &&;
|
||||
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>& <a href='doc_expected.md#tl::expected-T,E-'>operator=</a>(<a href='doc_expected.md#tl::expected-T,E-'>expected</a>&& rhs) = default;
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>expected</a>() = default;
|
||||
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>expected</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected</a>& rhs) = default;
|
||||
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>expected</a>(<a href='doc_expected.html#tl::expected-T,E-'>expected</a>&& rhs) = default;
|
||||
|
||||
<a href='doc_expected.html#tl::expected-T,E-'>expected</a>& <a href='doc_expected.html#tl::expected-T,E-'>operator=</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected</a>& rhs) = default;
|
||||
|
||||
<a href='doc_expected.html#tl::expected-T,E-'>expected</a>& <a href='doc_expected.html#tl::expected-T,E-'>operator=</a>(<a href='doc_expected.html#tl::expected-T,E-'>expected</a>&& rhs) = default;
|
||||
|
||||
template <class ... Args, 'hidden' ... = nullptr>
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>(<a href='doc_expected.md#tl::in_place_t'>in_place_t</a>, Args&&... args);
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>expected</a>(<a href='doc_expected.html#tl::in_place_t'>in_place_t</a>, Args&&... args);
|
||||
|
||||
template <class U, class ... Args, 'hidden' ... = nullptr>
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>(<a href='doc_expected.md#tl::in_place_t'>in_place_t</a>, <a href='http://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search=std::initializer_list%3cU%3e'>std::initializer_list<U></a> il, Args&&... args);
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>expected</a>(<a href='doc_expected.html#tl::in_place_t'>in_place_t</a>, <a href='http://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search=std::initializer_list%3cU%3e'>std::initializer_list<U></a> il, Args&&... args);
|
||||
|
||||
EXPLICIT constexpr expected(const unexpected<G> &e);
|
||||
EXPLICIT constexpr expected(unexpected<G> &&e);
|
||||
|
||||
template <class ... Args, 'hidden' ... = nullptr>
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>(<a href='doc_expected.md#tl::unexpect_t'>unexpect_t</a>, Args&&... args);
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>expected</a>(<a href='doc_expected.html#tl::unexpect_t'>unexpect_t</a>, Args&&... args);
|
||||
|
||||
template <class U, class G, 'hidden'>
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>(const <a href='doc_expected.md#tl::expected-T,E-'>expected<U, G></a>& rhs);
|
||||
template <class U, class G, 'hidden', 'hidden'>
|
||||
<a href='doc_expected.html#tl::expected-T,E-'>expected</a>(const <a href='doc_expected.html#tl::expected-T,E-'>expected<U, G></a>& rhs);
|
||||
|
||||
template <class U, class G, 'hidden'>
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>(<a href='doc_expected.md#tl::expected-T,E-'>expected<U, G></a>&& rhs);
|
||||
|
||||
template <class U = T, 'hidden'>
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>expected</a>(U&& v);
|
||||
template <class U, class G, 'hidden', 'hidden'>
|
||||
<a href='doc_expected.html#tl::expected-T,E-'>expected</a>(<a href='doc_expected.html#tl::expected-T,E-'>expected<U, G></a>&& rhs);
|
||||
|
||||
template <class U = T, 'hidden', 'hidden'>
|
||||
<a href='doc_expected.md#tl::expected-T,E-'>expected</a>& <a href='doc_expected.md#tl::expected-T,E-'>operator=</a>(U&& v);
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>expected</a>(U&& v);
|
||||
|
||||
template <class U = T, 'hidden', 'hidden'>
|
||||
<a href='doc_expected.html#tl::expected-T,E-'>expected</a>& <a href='doc_expected.html#tl::expected-T,E-'>operator=</a>(U&& v);
|
||||
|
||||
template <class G = E, 'hidden'>
|
||||
<a href='doc_expected.md#tl::expected-T,E-'>expected</a>& <a href='doc_expected.md#tl::expected-T,E-'>operator=</a>(const <a href='doc_expected.md#tl::unexpected-E-'>unexpected<G></a>& rhs);
|
||||
<a href='doc_expected.html#tl::expected-T,E-'>expected</a>& <a href='doc_expected.html#tl::expected-T,E-'>operator=</a>(const <a href='doc_expected.html#tl::unexpected-E-'>unexpected<G></a>& rhs);
|
||||
|
||||
template <class G = E, 'hidden'>
|
||||
<a href='doc_expected.md#tl::expected-T,E-'>expected</a>& <a href='doc_expected.md#tl::expected-T,E-'>operator=</a>(<a href='doc_expected.md#tl::unexpected-E-'>unexpected<G></a>&& rhs) noexcept;
|
||||
<a href='doc_expected.html#tl::expected-T,E-'>expected</a>& <a href='doc_expected.html#tl::expected-T,E-'>operator=</a>(<a href='doc_expected.html#tl::unexpected-E-'>unexpected<G></a>&& rhs) noexcept;
|
||||
|
||||
template <class ... Args, 'hidden' ... = nullptr>
|
||||
void <a href='doc_expected.md#tl::expected-T,E-'>emplace</a>(Args&&... args);
|
||||
void <a href='doc_expected.html#tl::expected-T,E-'>emplace</a>(Args&&... args);
|
||||
|
||||
template <class U, class ... Args, 'hidden' ... = nullptr>
|
||||
void <a href='doc_expected.md#tl::expected-T,E-'>emplace</a>(<a href='http://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search=std::initializer_list%3cU%3e'>std::initializer_list<U></a> il, Args&&... args);
|
||||
void <a href='doc_expected.html#tl::expected-T,E-'>emplace</a>(<a href='http://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search=std::initializer_list%3cU%3e'>std::initializer_list<U></a> il, Args&&... args);
|
||||
|
||||
void <a href='doc_expected.md#tl::expected-T,E-'>swap</a>(<a href='doc_expected.md#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&>())));
|
||||
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.md#tl::expected-T,E-'>operator-></a>() const;
|
||||
constexpr const T* <a href='doc_expected.html#tl::expected-T,E-'>operator-></a>() const;
|
||||
|
||||
constexpr T* <a href='doc_expected.md#tl::expected-T,E-'>operator-></a>();
|
||||
T* <a href='doc_expected.html#tl::expected-T,E-'>operator-></a>();
|
||||
|
||||
constexpr const T& <a href='doc_expected.md#tl::expected-T,E-'>operator*</a>() const &;
|
||||
constexpr const T& <a href='doc_expected.html#tl::expected-T,E-'>operator*</a>() const &;
|
||||
|
||||
constexpr T& <a href='doc_expected.md#tl::expected-T,E-'>operator*</a>() &;
|
||||
T& <a href='doc_expected.html#tl::expected-T,E-'>operator*</a>() &;
|
||||
|
||||
constexpr const T&& <a href='doc_expected.md#tl::expected-T,E-'>operator*</a>() const &&;
|
||||
constexpr const T&& <a href='doc_expected.html#tl::expected-T,E-'>operator*</a>() const &&;
|
||||
|
||||
constexpr T&& <a href='doc_expected.md#tl::expected-T,E-'>operator*</a>() &&;
|
||||
T&& <a href='doc_expected.html#tl::expected-T,E-'>operator*</a>() &&;
|
||||
|
||||
constexpr <a href='doc_expected.md#tl::expected-T,E-'>operator bool</a>() const noexcept;
|
||||
constexpr <a href='doc_expected.html#tl::expected-T,E-'>operator bool</a>() const noexcept;
|
||||
|
||||
constexpr bool <a href='doc_expected.md#tl::expected-T,E-'>has_value</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.md#tl::expected-T,E-'>value</a>() const &;
|
||||
constexpr const T& <a href='doc_expected.html#tl::expected-T,E-'>value</a>() const &;
|
||||
|
||||
constexpr T& <a href='doc_expected.md#tl::expected-T,E-'>value</a>() &;
|
||||
T& <a href='doc_expected.html#tl::expected-T,E-'>value</a>() &;
|
||||
|
||||
constexpr const T&& <a href='doc_expected.md#tl::expected-T,E-'>value</a>() const &&;
|
||||
constexpr const T&& <a href='doc_expected.html#tl::expected-T,E-'>value</a>() const &&;
|
||||
|
||||
constexpr T&& <a href='doc_expected.md#tl::expected-T,E-'>value</a>() &&;
|
||||
T&& <a href='doc_expected.html#tl::expected-T,E-'>value</a>() &&;
|
||||
|
||||
constexpr const E& <a href='doc_expected.md#tl::expected-T,E-'>error</a>() const &;
|
||||
constexpr const E& <a href='doc_expected.html#tl::expected-T,E-'>error</a>() const &;
|
||||
|
||||
constexpr E& <a href='doc_expected.md#tl::expected-T,E-'>error</a>() &;
|
||||
E& <a href='doc_expected.html#tl::expected-T,E-'>error</a>() &;
|
||||
|
||||
constexpr const E&& <a href='doc_expected.md#tl::expected-T,E-'>error</a>() const &&;
|
||||
constexpr const E&& <a href='doc_expected.html#tl::expected-T,E-'>error</a>() const &&;
|
||||
|
||||
constexpr E&& <a href='doc_expected.md#tl::expected-T,E-'>error</a>() &&;
|
||||
E&& <a href='doc_expected.html#tl::expected-T,E-'>error</a>() &&;
|
||||
|
||||
template <class U>
|
||||
constexpr T <a href='doc_expected.md#tl::expected-T,E-'>value_or</a>(U&& v) const &;
|
||||
constexpr T <a href='doc_expected.html#tl::expected-T,E-'>value_or</a>(U&& v) const &;
|
||||
|
||||
template <class U>
|
||||
T <a href='doc_expected.md#tl::expected-T,E-'>value_or</a>(U&& v) &&;
|
||||
T <a href='doc_expected.html#tl::expected-T,E-'>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.
|
||||
@@ -368,9 +392,12 @@ An `expected<T, E>` object is an object that contains the storage for another ob
|
||||
constexpr auto and_then(F &&f) &&;
|
||||
|
||||
(3) template <class F>
|
||||
constexpr auto and_then(F &&f) const &;</code></pre>
|
||||
constexpr auto and_then(F &&f) const &;
|
||||
|
||||
Carries out some operation which returns an optional on the stored object if there is one. \\requires `std::invoke(std::forward<F>(f), value())` returns a `std::optional<U>` for some `U`. \\returns Let `U` be the result of `std::invoke(std::forward<F>(f), value())`. Returns a `std::optional<U>`. The return value is empty if `*this` is empty, otherwise the return value of `std::invoke(std::forward<F>(f), value())` is returned. \\group and\_then \\synopsis template \<class F\>\\nconstexpr auto and\_then(F &\&f) &;
|
||||
(4) template <class F>
|
||||
constexpr auto and_then(F &&f) const &&;</code></pre>
|
||||
|
||||
Carries out some operation which returns an expected on the stored object if there is one. \\requires `std::invoke(std::forward<F>(f), value())` returns a `std::expected<U>` for some `U`. \\returns Let `U` be the result of `std::invoke(std::forward<F>(f), value())`. Returns a `std::expected<U>`. The return value is empty if `*this` is empty, otherwise the return value of `std::invoke(std::forward<F>(f), value())` is returned. \\group and\_then \\synopsis template \<class F\>\\nconstexpr auto and\_then(F &\&f) &;
|
||||
|
||||
### Function template `tl::expected::map`<a id="tl::expected-T,E-::map(F&&)&"></a>
|
||||
|
||||
@@ -378,7 +405,9 @@ Carries out some operation which returns an optional on the stored object if the
|
||||
|
||||
(2) template <class F> constexpr auto map(F &&f) &&;
|
||||
|
||||
(3) template <class F> constexpr auto map(F &&f) const &;</code></pre>
|
||||
(3) template <class F> constexpr auto map(F &&f) const &;
|
||||
|
||||
(4) template <class F> constexpr auto map(F &&f) const &&;</code></pre>
|
||||
|
||||
Carries out some operation on the stored object if there is one.
|
||||
|
||||
@@ -390,12 +419,25 @@ Carries out some operation on the stored object if there is one.
|
||||
|
||||
(2) template <class F> constexpr auto map_error(F &&f) &&;
|
||||
|
||||
(3) template <class F> constexpr auto map_error(F &&f) const &;</code></pre>
|
||||
(3) template <class F> constexpr auto map_error(F &&f) const &;
|
||||
|
||||
(4) template <class F> constexpr auto map_error(F &&f) const &&;</code></pre>
|
||||
|
||||
Carries out some operation on the stored unexpected object if there is one.
|
||||
|
||||
*Returns*: Let `U` be the result of `std::invoke(std::forward<F>(f), value())`. Returns a `std::expected<T,U>`. If `*this` has an expected value, the result is `*this`, otherwise an `expected<T,U>` is constructed from `make_unexpected(std::invoke(std::forward<F>(f), value()))` and is returned.
|
||||
|
||||
### Function template `tl::expected::or_else`<a id="tl::expected-T,E-::or_else(F&&)&"></a>
|
||||
|
||||
<pre><code class="language-cpp">(1) template <class F>
|
||||
<a href='doc_expected.html#tl::expected-T,E-'>expected</a> or_else(F&& f) &;</code></pre>
|
||||
|
||||
Calls `f` if the expectd is in the unexpected state
|
||||
|
||||
*Requires*: `std::invoke_result_t<F>` must be void or convertible to `expcted<T,E>`.
|
||||
|
||||
*Effects*: If `*this` has a value, returns `*this`. Otherwise, if `f` returns `void`, calls `std::forward<F>(f)` and returns `std::nullopt`. Otherwise, returns `std::forward<F>(f)()`.
|
||||
|
||||
### Function template `tl::expected::expected`<a id="tl::expected-T,E-::expected(constunexpected-G-&)"></a>
|
||||
|
||||
<pre><code class="language-cpp">(1) EXPLICIT constexpr expected(const unexpected<G> &e);
|
||||
|
@@ -1,2 +1,3 @@
|
||||
[output]
|
||||
format=commonmark
|
||||
link_extension=html
|
||||
|
Reference in New Issue
Block a user