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 non-default-constructible success values. More...

#include <result.h>

Public Types

using success_type = T
 
using success_storage = detail::erased_storage< T >
 
using error_type = Error
 

Public Member Functions

 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 const success_typevalue () const 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 non-default-constructible success values.

Not optimized for space-efficiency. error is used as the error value and discriminant flag.

Definition at line 252 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 259 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_storage = detail::erased_storage<T>

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

Constructor & Destructor Documentation

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

Definition at line 261 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 262 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 286 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 290 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 264 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 268 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 272 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 277 of file result.h.

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

Definition at line 281 of file result.h.


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