scnlib  0.1.2
FormattedinputformodernC++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
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

SCN_CONSTEXPR expected (success_type s)
 
SCN_CONSTEXPR expected (error_type e)
 
SCN_CONSTEXPR bool has_value () const noexcept
 
SCN_CONSTEXPR operator bool () const noexcept
 
SCN_CONSTEXPR bool operator! () const noexcept
 
SCN_CONSTEXPR14 success_typevalue ()&noexcept
 
SCN_CONSTEXPR success_type value () const &noexcept
 
SCN_CONSTEXPR14 success_type value ()&&noexcept
 
SCN_CONSTEXPR14 error_typeerror () noexcept
 
SCN_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 195 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 201 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 200 of file result.h.

Constructor & Destructor Documentation

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

Definition at line 203 of file result.h.

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

Definition at line 204 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 232 of file result.h.

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

Definition at line 236 of file result.h.

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

Definition at line 206 of file result.h.

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

Definition at line 210 of file result.h.

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

Definition at line 214 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 219 of file result.h.

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

Definition at line 223 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 227 of file result.h.


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