mitteLib
Loading...
Searching...
No Matches
mlab::result< E, T > Class Template Reference

#include <result.hpp>

Inheritance diagram for mlab::result< E, T >:
Collaboration diagram for mlab::result< E, T >:

Public Types

using error_type = E
 
using value_type = T
 
using value_type_as_tuple = std::tuple<T>
 

Public Member Functions

 result ()=default
 
 result (result &&) noexcept=default
 
 result (result const &other)
 
 result (E error)
 
 result (T data)
 
resultoperator= (E error)
 
resultoperator= (T data)
 
resultoperator= (result &&) noexcept=default
 
resultoperator= (result const &other)
 
T & operator* ()
 
T const & operator* () const
 
T * operator-> ()
 
T const * operator-> () const
 
T const & release () const &
 
T & release () &
 
T && release () &&
 
 operator bool () const
 
error () const
 
enum_type type () const
 

Static Public Attributes

static constexpr std::size_t value_size = 1
 

Private Types

template<result_content RC>
using content_wrap = typename result_impl<E, T>::template content_wrap<RC>
 
using base = any_of<result_content, result_impl<E, T>::template content_wrap, result_content::error>
 
- Private Types inherited from mlab::any_of< result_content, result_impl< E, T >::template content_wrap, result_content::error >
using value_type
 
using enum_type
 

Additional Inherited Members

- Private Member Functions inherited from mlab::any_of< result_content, result_impl< E, T >::template content_wrap, result_content::error >
 any_of ()
 
 any_of (T< E > obj)
 
 any_of (any_of &&other) noexcept
 
 any_of (any_of const &)=delete
 
any_ofoperator= (any_of &&other) noexcept
 
any_ofoperator= (any_of const &)=delete
 
any_ofoperator= (T< E > obj)
 
any_of< result_content, T, Default > & operator= (T< E > obj)
 
 ~any_of ()
 
enum_type type () const
 
T< E > const & get () const
 
T< E > & get ()
 
T< E > const & get () const
 
 any_of (enum_type e)
 
void set (U &&obj)
 
- Static Private Attributes inherited from mlab::any_of< result_content, result_impl< E, T >::template content_wrap, result_content::error >
static constexpr enum_type default_type
 

Member Typedef Documentation

◆ base

template<class E , class T >
using mlab::result< E, T >::base = any_of<result_content, result_impl<E, T>::template content_wrap, result_content::error>
private

◆ content_wrap

template<class E , class T >
template<result_content RC>
using mlab::result< E, T >::content_wrap = typename result_impl<E, T>::template content_wrap<RC>
private

◆ error_type

template<class E , class T >
using mlab::result< E, T >::error_type = E

◆ value_type

template<class E , class T >
using mlab::result< E, T >::value_type = T

◆ value_type_as_tuple

template<class E , class T >
using mlab::result< E, T >::value_type_as_tuple = std::tuple<T>

Constructor & Destructor Documentation

◆ result() [1/5]

template<class E , class T >
mlab::result< E, T >::result ( )
default

◆ result() [2/5]

template<class E , class T >
mlab::result< E, T >::result ( result< E, T > && )
defaultnoexcept

◆ result() [3/5]

template<class E , class T >
mlab::result< E, T >::result ( result< E, T > const & other)
inline

◆ result() [4/5]

template<class E , class T >
mlab::result< E, T >::result ( E error)
inline

◆ result() [5/5]

template<class E , class T >
mlab::result< E, T >::result ( T data)
inline

Member Function Documentation

◆ error()

template<class E , class T >
E mlab::result< E, T >::error ( ) const
inlinenodiscard

◆ operator bool()

template<class E , class T >
mlab::result< E, T >::operator bool ( ) const
inlineexplicit

◆ operator*() [1/2]

template<class E , class T >
T & mlab::result< E, T >::operator* ( )
inlinenodiscard

◆ operator*() [2/2]

template<class E , class T >
T const & mlab::result< E, T >::operator* ( ) const
inlinenodiscard

◆ operator->() [1/2]

template<class E , class T >
T * mlab::result< E, T >::operator-> ( )
inlinenodiscard

◆ operator->() [2/2]

template<class E , class T >
T const * mlab::result< E, T >::operator-> ( ) const
inlinenodiscard

◆ operator=() [1/4]

template<class E , class T >
result< E, T > & mlab::result< E, T >::operator= ( E error)

◆ operator=() [2/4]

template<class E , class T >
result & mlab::result< E, T >::operator= ( result< E, T > && )
defaultnoexcept

◆ operator=() [3/4]

template<class E , class T >
result & mlab::result< E, T >::operator= ( result< E, T > const & other)

◆ operator=() [4/4]

template<class E , class T >
result< E, T > & mlab::result< E, T >::operator= ( T data)

◆ release() [1/3]

template<class E , class T >
T & mlab::result< E, T >::release ( ) &
nodiscard

◆ release() [2/3]

template<class E , class T >
T && mlab::result< E, T >::release ( ) &&
nodiscard

◆ release() [3/3]

template<class E , class T >
T const & mlab::result< E, T >::release ( ) const &
nodiscard

◆ type()

template<class E , class T >
Enum mlab::any_of< Enum, T, Default >::type ( ) const
nodiscard

Member Data Documentation

◆ value_size

template<class E , class T >
std::size_t mlab::result< E, T >::value_size = 1
staticconstexpr

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