scnlib  0.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type > Class Template Reference

expected-like type for default-constructible success values. More...

#include <result.h>

Public Types

using success_type = T
 
using error_type = Error
 

Public Member Functions

constexpr expected (success_type s)
 
constexpr expected (error_type e)
 
constexpr bool has_value () const noexcept
 
constexpr operator bool () const noexcept
 
constexpr bool operator! () const noexcept
 
SCN_CONSTEXPR14 success_typevalue ()&noexcept
 
constexpr success_type value () const &noexcept
 
SCN_CONSTEXPR14 success_type value ()&&noexcept
 
SCN_CONSTEXPR14 error_typeerror () noexcept
 
constexpr error_type error () const noexcept
 

Detailed Description

template<typename T, typename Error>
class scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >

expected-like type for default-constructible success values.

Not optimized for space-efficiency (both members are stored simultaneously). error is used as the error value and discriminant flag.

Definition at line 189 of file result.h.

Member Typedef Documentation

template<typename T , typename Error >
using scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::error_type = Error

Definition at line 195 of file result.h.

template<typename T , typename Error >
using scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::success_type = T

Definition at line 194 of file result.h.

Constructor & Destructor Documentation

template<typename T , typename Error >
constexpr scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::expected ( success_type  s)
inline

Definition at line 197 of file result.h.

template<typename T , typename Error >
constexpr scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::expected ( error_type  e)
inline

Definition at line 198 of file result.h.

Member Function Documentation

template<typename T , typename Error >
SCN_CONSTEXPR14 error_type& scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::error ( )
inlinenoexcept

Definition at line 226 of file result.h.

template<typename T , typename Error >
constexpr error_type scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::error ( ) const
inlinenoexcept

Definition at line 230 of file result.h.

template<typename T , typename Error >
constexpr bool scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::has_value ( ) const
inlinenoexcept

Definition at line 200 of file result.h.

template<typename T , typename Error >
constexpr scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 204 of file result.h.

template<typename T , typename Error >
constexpr bool scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::operator! ( ) const
inlinenoexcept

Definition at line 208 of file result.h.

template<typename T , typename Error >
SCN_CONSTEXPR14 success_type& scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::value ( )
inlinenoexcept

Definition at line 213 of file result.h.

template<typename T , typename Error >
constexpr success_type scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::value ( ) const
inlinenoexcept

Definition at line 217 of file result.h.

template<typename T , typename Error >
SCN_CONSTEXPR14 success_type scn::expected< T, Error, typename std::enable_if< std::is_default_constructible< T >::value >::type >::value ( )
inlinenoexcept

Definition at line 221 of file result.h.


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