STX  1.0.0
List of all members
stx::Result< T, E > Struct Template Reference

#include <option_result.h>

Detailed Description

template<typename T, typename E>
struct stx::Result< T, E >

Error handling with the Result type.

Result<T, E> is a type used for returning and propagating errors. It is a class with the variants: Ok<T>, representing success and containing a value, and Err<E>, representing error and containing an error value.

Functions return Result whenever errors are expected and recoverable.

A simple function returning Result might be defined and used like so:

enum class Version { Version1 = 1, Version2 = 2 };
auto parse_version =
[](array<uint8_t, 5> const& header) -> Result<Version, string_view> {
switch (header.at(0)) {
case 1:
return Ok(Version::Version1);
case 2:
return Ok(Version::Version2);
default:
return Err("invalid version"sv);
}
};
parse_version({1, 2, 3, 4, 5})
[](auto version) {
std::cout << "Working with version: "
<< static_cast<int>(version) << "\n";
},
[](auto err) {
std::cout << "Error parsing header: " << err << "\n";
});

Result comes with some convenience methods that make working with it more succinct.

Result<int, int> good_result = Ok(10);
Result<int, int> bad_result = Err(10);
// The `is_ok` and `is_err` methods do what they say.
ASSERT_TRUE(good_result.is_ok() && !good_result.is_err());
ASSERT_TRUE(bad_result.is_err() && !bad_result.is_ok());

Result is a type that represents either success (Ok) or failure (Err).

Result is either in the Ok or Err state at any point in time

Constexpr ?

C++ 20 and above

Note

Result unlike Option is a value-forwarding type. It doesn't have copy constructors of any sort. More like a unique_ptr.

Result should be seen as a return channel (for returning from functions) and not an object.

Member Typedef Documentation

◆ error_type

template<typename T, typename E>
using stx::Result< T, E >::error_type = E

◆ value_type

template<typename T, typename E>
using stx::Result< T, E >::value_type = T

Constructor & Destructor Documentation

◆ Result() [1/5]

template<typename T, typename E>
constexpr stx::Result< T, E >::Result ( Ok< T > &&  result)
inline

◆ Result() [2/5]

template<typename T, typename E>
constexpr stx::Result< T, E >::Result ( Err< E > &&  err)
inline

◆ Result() [3/5]

template<typename T, typename E>
stx::Result< T, E >::Result ( Result< T, E > &&  rhs)
inline

◆ Result() [4/5]

template<typename T, typename E>
stx::Result< T, E >::Result ( )
delete

◆ Result() [5/5]

template<typename T, typename E>
stx::Result< T, E >::Result ( Result< T, E > const &  rhs)
delete

◆ ~Result()

template<typename T, typename E>
STX_CXX20_DESTRUCTOR_CONSTEXPR stx::Result< T, E >::~Result ( )
inlinenoexcept

Member Function Documentation

◆ AND()

template<typename T, typename E>
template<typename U , typename F >
constexpr auto stx::Result< T, E >::AND ( Result< U, F > &&  res) && -> Result<U, F>
inline

Returns res if the result is Ok, otherwise returns the Err value of itself.

Examples

Basic usage:

Result<int, string_view> a = Ok(2);
Result<string_view, string_view> b = Err("late error"sv);
ASSERT_EQ(move(a).AND(move(b)), Err("late error"sv));
Result<int, string_view> c = Err("early error"sv);
Result<string_view, string_view> d = Ok("foo"sv);
ASSERT_EQ(move(c).AND(move(d)), Err("early error"sv));
Result<int, string_view> e = Err("not a 2"sv);
Result<string_view, string_view> f = Err("late error"sv);
ASSERT_EQ(move(e).AND(move(f)), Err("not a 2"sv));
Result<int, string_view> g = Ok(2);
Result<string_view, string_view> h = Ok("different result type"sv);
ASSERT_EQ(move(g).AND(move(h)), Ok("different result type"sv));

◆ and_then()

template<typename T, typename E>
template<typename Fn >
constexpr auto stx::Result< T, E >::and_then ( Fn &&  op) && -> Result<invoke_result<Fn&&, T&&>, E>
inline

Calls op if the result is Ok, otherwise returns the Err value of itself.

This function can be used for control flow based on Result values.

Examples

Basic usage:

auto sq = [](int x) { return x * x; };
auto make_ok = [](int x) -> Result<int, int> { return Ok(move(x)); };
auto make_err = [](int x) -> Result<int, int> { return Err(move(x)); };
ASSERT_EQ(make_ok(2).and_then(sq).and_then(sq), Ok(16));
ASSERT_EQ(make_err(3).and_then(sq).and_then(sq), Err(3));

◆ as_cref() [1/2]

template<typename T, typename E>
constexpr auto stx::Result< T, E >::as_cref ( ) const & -> Result<ConstRef<T>, ConstRef<E>>
inlinenoexcept

Converts from Result<T, E> & to Result<ConstRef<T>, ConstRef<E>>.

Produces a new Result, containing an immutable reference into the original, leaving the original in place.

Examples

Basic usage:

Result<int, string> x = Ok(2);
ASSERT_EQ(x.as_cref().unwrap().get(), 2);
Result<int, string> y = Err("Error"s);
ASSERT_EQ(y.as_cref().unwrap_err().get(), "Error"s);

◆ as_cref() [2/2]

template<typename T, typename E>
constexpr auto stx::Result< T, E >::as_cref ( ) const && -> Result< ConstRef< T >, ConstRef< E >>=delete
deletenoexcept

◆ as_ref() [1/4]

template<typename T, typename E>
constexpr auto stx::Result< T, E >::as_ref ( ) & -> Result<MutRef<T>, MutRef<E>>
inlinenoexcept

Converts from Result<T, E> & to Result<MutRef<T>, MutRef<E>>.

Examples

Basic usage:

auto mutate = [](Result<int, int>& r) {
r.as_ref().match([](auto ok) { ok.get() = 42; },
[](auto err) { err.get() = 0; });
};
Result<int, int> x = Ok(2);
mutate(x);
ASSERT_EQ(x, Ok(42));
Result<int, int> y = Err(13);
mutate(y);
ASSERT_EQ(y, Err(0));

◆ as_ref() [2/4]

template<typename T, typename E>
constexpr auto stx::Result< T, E >::as_ref ( ) const & -> Result<ConstRef<T>, ConstRef<E>>
inlinenoexcept

◆ as_ref() [3/4]

template<typename T, typename E>
constexpr auto stx::Result< T, E >::as_ref ( ) && -> Result< MutRef< T >, MutRef< E >>=delete
deletenoexcept

◆ as_ref() [4/4]

template<typename T, typename E>
constexpr auto stx::Result< T, E >::as_ref ( ) const && -> Result< ConstRef< T >, ConstRef< E >>=delete
deletenoexcept

◆ clone()

template<typename T, typename E>
constexpr auto stx::Result< T, E >::clone ( ) const -> Result<T, E>
inline

Returns a copy of the result and its contents.

Examples

Basic usage:

Result<int, int> x = Ok(8);
ASSERT_EQ(x, x.clone());

◆ contains()

template<typename T, typename E>
template<typename CmpType >
constexpr bool stx::Result< T, E >::contains ( CmpType const &  cmp) const
inline

Returns true if the result is an Ok<T> variant and contains the given value.

Examples

Basic usage:

Result<int, string> x = Ok(2);
ASSERT_TRUE(x.contains(2));
Result<int, string> y = Ok(3);
ASSERT_FALSE(y.contains(2));
Result<int, string> z = Err("Some error message"s);
ASSERT_FALSE(z.contains(2));

◆ contains_err()

template<typename T, typename E>
template<typename ErrCmp >
constexpr bool stx::Result< T, E >::contains_err ( ErrCmp const &  cmp) const
inline

Returns true if the result is an Err<E> variant containing the given value.

Examples

Basic usage:

Result<int, string> x = Ok(2);
ASSERT_FALSE(x.contains_err("Some error message"s));
Result<int, string> y = Err("Some error message"s);
ASSERT_TRUE(y.contains_err("Some error message"s));
Result<int, string> z = Err("Some other error message"s);
ASSERT_FALSE(z.contains_err("Some error message"s));

◆ err()

template<typename T, typename E>
constexpr auto stx::Result< T, E >::err ( ) && -> Option<E>
inline

Converts from Result<T, E> to Option<E>.

Converts this result into an Option<E>, consuming itself, and discarding the success value, if any.

Examples

Basic usage:

Result<int, string> x = Ok(2);
ASSERT_EQ(move(x).err(), None);
Result<int, string> y = Err("Nothing here"s);
ASSERT_EQ(move(y).err(), Some("Nothing here"s));

◆ err_exists()

template<typename T, typename E>
template<typename UnaryPredicate >
constexpr bool stx::Result< T, E >::err_exists ( UnaryPredicate &&  predicate) const
inline

Returns the value of evaluating the predicate on the contained value if the Option is a Some, else returns false.

Examples

Basic usage:

Result<int, string> x = Err("invalid"s);
auto invalid = [](auto x) { return x == "invalid"; };
ASSERT_TRUE(x.err_exists(invalid));

◆ err_value() [1/4]

template<typename T, typename E>
E& stx::Result< T, E >::err_value ( ) &
inlinenoexcept

Returns an l-value reference to the contained error value. Note that no copying occurs here.

Panics

Panics if the value is an Ok

Examples

Basic usage:

auto result = make_err<int, int>(9);
int& err = result.err_value();
err = 46;
ASSERT_EQ(result, Err(46));

◆ err_value() [2/4]

template<typename T, typename E>
E const& stx::Result< T, E >::err_value ( ) const &
inlinenoexcept

Returns a const l-value reference to the contained error value. Note that no copying occurs here.

Panics

Panics if the value is an Ok

Examples

Basic usage:

auto const result = make_err<int, int>(9);
int const& err = result.err_value();
ASSERT_EQ(err, 9);

◆ err_value() [3/4]

template<typename T, typename E>
E stx::Result< T, E >::err_value ( ) &&
delete

Use unwrap_err() instead.

◆ err_value() [4/4]

template<typename T, typename E>
E const stx::Result< T, E >::err_value ( ) const &&
delete

Use unwrap_err() instead.

◆ exists()

template<typename T, typename E>
template<typename UnaryPredicate >
constexpr bool stx::Result< T, E >::exists ( UnaryPredicate &&  predicate) const
inline

Returns the value of evaluating the predicate on the contained value if the Option is a Some, else returns false.

Examples

Basic usage:

Result<int, string> x = Ok(2);
auto even = [](auto x) { return x == 2; };
ASSERT_TRUE(x.exists(even));

◆ expect()

template<typename T, typename E>
auto stx::Result< T, E >::expect ( std::string_view const &  msg) && -> T
inline

Unwraps a result, yielding the content of an Ok.

Panics

Panics if the value is an Err, with a panic message including the passed message, and the content of the Err.

Examples

Basic usage:

Result<int, string_view> x = Err("emergency failure"sv);
ASSERT_DEATH(move(x).expect("Testing expect"));

◆ expect_err()

template<typename T, typename E>
auto stx::Result< T, E >::expect_err ( std::string_view const &  msg) && -> E
inline

Unwraps a result, yielding the content of an Err.

Panics

Panics if the value is an Ok, with a panic message including the passed message, and the content of the Ok.

Examples

Basic usage:

Result<int, string_view> x = Ok(10);
ASSERT_DEATH(move(x).expect_err("Testing expect_err")); // panics with
// "Testing
// expect_err:
// 10"

◆ is_err()

template<typename T, typename E>
constexpr bool stx::Result< T, E >::is_err ( ) const
inlinenoexcept

Returns true if the result is Err<T>.

Examples

Basic usage:

Result<int, string_view> x = Ok(-3);
ASSERT_FALSE(x.is_err());
Result<int, string_view> y = Err("Some error message"sv);
ASSERT_TRUE(y.is_err());

◆ is_ok()

template<typename T, typename E>
constexpr bool stx::Result< T, E >::is_ok ( ) const
inlinenoexcept

Returns true if the result is an Ok<T> variant.

Examples

Basic usage:

Result<int, string_view> x = Ok(-3);
ASSERT_TRUE(x.is_ok());
Result<int, string_view> y = Err("Some error message"sv);
ASSERT_FALSE(y.is_ok());

◆ map()

template<typename T, typename E>
template<typename Fn >
constexpr auto stx::Result< T, E >::map ( Fn &&  op) && -> Result<invoke_result<Fn&&, T&&>, E>
inline

Maps a Result<T, E> to Result<U, E> by applying the function op to the contained Ok<T> value, leaving an Err<E> value untouched.

This function can be used to compose the results of two functions.

Examples

Basic usage:

Extract the content-type from an http header

enum class Error { InvalidHeader };
auto header = "Content-Type: multipart/form-data"sv;
auto check_header = [](string_view s) -> Result<string_view, Error> {
if (!s.starts_with("Content-Type: "sv)) return Err(Error::InvalidHeader);
return Ok(move(s));
};
auto content_type =
check_header(header).map([](auto s) { return s.substr(14); });
ASSERT_EQ(content_type, Ok("multipart/form-data"sv));

◆ map_err()

template<typename T, typename E>
template<typename Fn >
constexpr auto stx::Result< T, E >::map_err ( Fn &&  op) && -> Result<T, invoke_result<Fn&&, E&&>>
inline

Maps a Result<T, E> to Result<T, F> by applying a function to a contained Err value, leaving an Ok value untouched.

This function can be used to pass through a successful result while handling an error.

Examples

Basic usage:

auto stringify = [](auto x) { return "error code: " + std::to_string(x);
};
Result<int, int> x = Ok(2);
ASSERT_EQ(move(x).map_err(stringify), Ok(2));
Result<int, int> y = Err(404);
ASSERT_EQ(move(y).map_err(stringify), Err("error code: 404"s));

◆ map_or()

template<typename T, typename E>
template<typename Fn , typename AltType >
constexpr auto stx::Result< T, E >::map_or ( Fn &&  op,
AltType &&  alt 
) && -> invoke_result<Fn&&, T&&>
inline

Applies a function to the contained value (if any), or returns the provided default (if not).

Examples

Basic usage:

Result<string, int> x = Ok("foo"s);
auto map_fn = [](auto s) { return s.size(); };
ASSERT_EQ(move(x).map_or(map_fn, 42UL), 3UL);
Result<string, int> y = Err(-404);
ASSERT_EQ(move(y).map_or(map_fn, 42UL), 42UL);

◆ map_or_else()

template<typename T, typename E>
template<typename Fn , typename A >
constexpr auto stx::Result< T, E >::map_or_else ( Fn &&  op,
A &&  alt_op 
) && -> invoke_result<Fn&&, T&&>
inline

Maps a Result<T, E> to U by applying a function to a contained Ok value, or a fallback function to a contained Err value.

This function can be used to unpack a successful result while handling an error.

Examples

Basic usage:

size_t const k = 21;
Result<string_view, size_t> x = Ok("foo"sv);
auto map_fn = [](auto s) { return s.size(); };
auto else_fn = [&](auto) { return k * 2UL; };
ASSERT_EQ(move(x).map_or_else(map_fn, else_fn), 3);
Result<string_view, size_t> y = Err(404UL);
ASSERT_EQ(move(y).map_or_else(map_fn, else_fn), 42);

◆ match() [1/3]

template<typename T, typename E>
template<typename OkFn , typename ErrFn >
constexpr auto stx::Result< T, E >::match ( OkFn &&  ok_fn,
ErrFn &&  err_fn 
) && -> invoke_result<OkFn&&, T&&>
inline

Calls the parameter ok_fn with the value if this result is an Ok<T>, else calls err_fn with the error. This result is consumed afterward.

The return type of both parameters must be convertible. They can also both return nothing ( void ).

Examples

Basic usage:

auto i = make_ok<int, string_view>(99);
auto j = move(i).match([](int value) { return value; },
[](string_view) { return -1; });
ASSERT_EQ(j, 99);
auto x = make_err<int, string_view>("404 Not Found"sv);
// you can return nothing (void)
x.match([](int&) {},
[](string_view& s) { std::cout << "Error: " << s << "\n"; });

Notes

  • The Result's reference type is passed to the function arguments. i.e. If the Result is an r-value, r-value references are passed to the function arguments some_fn and none_fn.

◆ match() [2/3]

template<typename T, typename E>
template<typename OkFn , typename ErrFn >
constexpr auto stx::Result< T, E >::match ( OkFn &&  ok_fn,
ErrFn &&  err_fn 
) & -> invoke_result<OkFn&&, T&>
inline

◆ match() [3/3]

template<typename T, typename E>
template<typename OkFn , typename ErrFn >
constexpr auto stx::Result< T, E >::match ( OkFn &&  ok_fn,
ErrFn &&  err_fn 
) const & -> invoke_result<OkFn&&, T const&>
inline

◆ ok()

template<typename T, typename E>
constexpr auto stx::Result< T, E >::ok ( ) && -> Option<T>
inline

Converts from Result<T, E> to Option<T>.

Converts this result into an Option<T>, consuming itself, and discarding the error, if any.

Examples

Basic usage:

Result<int, string> x = Ok(2);
ASSERT_EQ(move(x).ok(), Some(2));
Result<int, string> y = Err("Nothing here"s);
ASSERT_EQ(move(y).ok(), None);

◆ operator bool()

template<typename T, typename E>
stx::Result< T, E >::operator bool ( ) const
inlinenoexcept

◆ operator!=() [1/3]

template<typename T, typename E>
template<typename U >
constexpr bool stx::Result< T, E >::operator!= ( Ok< U > const &  cmp) const
inline

◆ operator!=() [2/3]

template<typename T, typename E>
template<typename F >
constexpr bool stx::Result< T, E >::operator!= ( Err< F > const &  cmp) const
inline

◆ operator!=() [3/3]

template<typename T, typename E>
template<typename U , typename F >
constexpr bool stx::Result< T, E >::operator!= ( Result< U, F > const &  cmp) const
inline

◆ operator=() [1/2]

template<typename T, typename E>
Result& stx::Result< T, E >::operator= ( Result< T, E > &&  rhs)
inline

◆ operator=() [2/2]

template<typename T, typename E>
Result& stx::Result< T, E >::operator= ( Result< T, E > const &  rhs)
delete

◆ operator==() [1/3]

template<typename T, typename E>
template<typename U >
constexpr bool stx::Result< T, E >::operator== ( Ok< U > const &  cmp) const
inline

◆ operator==() [2/3]

template<typename T, typename E>
template<typename F >
constexpr bool stx::Result< T, E >::operator== ( Err< F > const &  cmp) const
inline

◆ operator==() [3/3]

template<typename T, typename E>
template<typename U , typename F >
constexpr bool stx::Result< T, E >::operator== ( Result< U, F > const &  cmp) const
inline

◆ OR()

template<typename T, typename E>
template<typename U , typename F >
constexpr auto stx::Result< T, E >::OR ( Result< U, F > &&  alt) && -> Result<U, F>
inline

Returns res if the result is Err, otherwise returns the Ok value of itself.

Arguments passed to or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use or_else, which is lazily evaluated.

Examples

Basic usage:

Result<int, string_view> a = Ok(2);
Result<int, string_view> b = Err("late error"sv);
ASSERT_EQ(move(a).OR(move(b)), Ok(2));
Result<int, string_view> c = Err("early error"sv);
Result<int, string_view> d = Ok(2);
ASSERT_EQ(move(c).OR(move(d)), Ok(2));
Result<int, string_view> e = Err("not a 2"sv);
Result<int, string_view> f = Err("late error"sv);
ASSERT_EQ(move(e).OR(move(f)), Err("late error"sv));
Result<int, string_view> g = Ok(2);
Result<int, string_view> h = Ok(100);
ASSERT_EQ(move(g).OR(move(h)), Ok(2));

◆ or_else()

template<typename T, typename E>
template<typename Fn >
constexpr auto stx::Result< T, E >::or_else ( Fn &&  op) && -> invoke_result<Fn&&, E&&>
inline

Calls op if the result is Err, otherwise returns the Ok value of itself.

This function can be used for control flow based on result values.

Examples

Basic usage:

auto make_ok = [](int x) -> Result<int, int> { return Ok(move(x)); };
auto make_err = [](int x) -> Result<int, int> { return Err(move(x)); };
auto sq = [](int err) -> Result<int, int> { return Ok(err * err); };
auto err = [](int err) -> Result<int, int> { return Err(move(err)); };
ASSERT_EQ(make_ok(2).or_else(sq).or_else(sq), Ok(2));
ASSERT_EQ(make_ok(2).or_else(err).or_else(sq), Ok(2));
ASSERT_EQ(make_err(3).or_else(sq).or_else(err), Ok(9));
ASSERT_EQ(make_err(3).or_else(err).or_else(err), Err(3));

◆ unwrap()

template<typename T, typename E>
auto stx::Result< T, E >::unwrap ( ) && -> T
inline

Unwraps a result, yielding the content of an Ok.

Panics

Panics if the value is an Err, with a panic message provided by the Err's value.

Examples

Basic usage:

ASSERT_EQ(make_ok<int, string_view>(2).unwrap(), 2);
Result<int, string_view> x = Err("emergency failure"sv);
ASSERT_DEATH(move(x).unwrap());

◆ unwrap_err()

template<typename T, typename E>
auto stx::Result< T, E >::unwrap_err ( ) && -> E
inline

Unwraps a result, yielding the content of an Err.

Panics

Panics if the value is an Ok, with a custom panic message provided by the Ok's value.

Examples

Basic usage:

Result<int, string_view> x = Ok(2);
ASSERT_DEATH(move(x).unwrap_err()); // panics
Result<int, string_view> y = Err("emergency failure"sv);
ASSERT_EQ(move(y).unwrap_err(), "emergency failure");

◆ unwrap_or()

template<typename T, typename E>
constexpr auto stx::Result< T, E >::unwrap_or ( T &&  alt) && -> T
inline

Unwraps a result, yielding the content of an Ok<T> variant. Else, it returns the parameter alt.

Arguments passed to unwrap_or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use unwrap_or_else, which is lazily evaluated.

Examples

Basic usage:

int alt = 2;
Result<int, string_view> x = Ok(9);
ASSERT_EQ(move(x).unwrap_or(move(alt)), 9);
int alt_b = 2;
Result<int, string_view> y = Err("error"sv);
ASSERT_EQ(move(y).unwrap_or(move(alt_b)), 2);

◆ unwrap_or_default()

template<typename T, typename E>
constexpr auto stx::Result< T, E >::unwrap_or_default ( ) && -> T
inline

Returns the contained value or a default

Consumes itself then, if Ok, returns the contained value, otherwise if Err, returns the default value for that type.

Examples

Basic usage:

Result<string, int> good_year = Ok("1909"s);
Result<string, int> bad_year = Err(-1);
ASSERT_EQ(move(good_year).unwrap_or_default(), "1909"s);
ASSERT_EQ(move(bad_year).unwrap_or_default(), ""s); // empty string (""s)
// is the default
// value
// for a C++ string

◆ unwrap_or_else()

template<typename T, typename E>
template<typename Fn >
constexpr auto stx::Result< T, E >::unwrap_or_else ( Fn &&  op) && -> T
inline

Unwraps a result, yielding the content of an Ok. If the value is an Err then it calls op with its value.

Examples

Basic usage:

auto count = [] (string_view err) { return err.size(); };
ASSERT_EQ(make_ok<size_t,string_view>(2UL).unwrap_or_else(count), 2);
ASSERT_EQ(make_err<size_t,string_view>("booo"sv).unwrap_or_else(count),
4);

◆ value() [1/4]

template<typename T, typename E>
T& stx::Result< T, E >::value ( ) &
inlinenoexcept

Returns an l-value reference to the contained value. Note that no copying occurs here.

Panics

Panics if the value is an Err

Examples

Basic usage:

auto result = make_ok<int, int>(6);
int& value = result.value();
value = 97;
ASSERT_EQ(result, Ok(97));

◆ value() [2/4]

template<typename T, typename E>
T const& stx::Result< T, E >::value ( ) const &
inlinenoexcept

Returns an l-value reference to the contained value. Note that no copying occurs here.

Panics

Panics if the value is an Err

Examples

Basic usage:

auto const result = make_ok<int, int>(6);
int const& value = result.value();
ASSERT_EQ(value, 6);

◆ value() [3/4]

template<typename T, typename E>
T stx::Result< T, E >::value ( ) &&
delete

Use unwrap() instead.

◆ value() [4/4]

template<typename T, typename E>
T const stx::Result< T, E >::value ( ) const &&
delete

Use unwrap() instead.

Friends And Related Function Documentation

◆ internal::result::unsafe_err_move

template<typename T, typename E>
template<typename Tp , typename Er >
Er&& internal::result::unsafe_err_move ( Result< Tp, Er > &  )
friend

◆ internal::result::unsafe_value_move

template<typename T, typename E>
template<typename Tp , typename Er >
Tp&& internal::result::unsafe_value_move ( Result< Tp, Er > &  )
friend

Member Data Documentation

◆ storage_err_

template<typename T, typename E>
E stx::Result< T, E >::storage_err_

◆ storage_value_

template<typename T, typename E>
T stx::Result< T, E >::storage_value_

The documentation for this struct was generated from the following file: