JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
jsonv::result_value_operations< TSelf, TValue > Class Template Reference

The set of result operations which depend on the type of TValue. More...

#include <jsonv/result.hpp>

+ Inheritance diagram for jsonv::result_value_operations< TSelf, TValue >:

Public Types

using value_type = TValue
 See result::value_type.
 

Public Member Functions

const value_typevalue () const &
 
value_typevalue () &
 
value_type && value () &&
 
template<typename UValue >
constexpr value_type value_or (UValue &&recovery_value) const &noexcept(std::is_nothrow_copy_constructible_v< value_type > &&std::is_nothrow_constructible_v< value_type, UValue >)
 
template<typename UValue >
constexpr value_type value_or (UValue &&recovery_value) &&noexcept(std::is_nothrow_move_constructible_v< value_type > &&std::is_nothrow_constructible_v< value_type, UValue >)
 
const value_typeoperator* () const &
 
value_typeoperator* () &
 
value_type && operator* () &&
 
const value_typeoperator-> () const
 
value_typeoperator-> ()
 

Detailed Description

template<typename TSelf, typename TValue>
class jsonv::result_value_operations< TSelf, TValue >

The set of result operations which depend on the type of TValue.

This is how result gets operations like value_or, operator*, and operator->. If TValue is void, those operations are not available.

See also
result

Definition at line 692 of file result.hpp.

Member Typedef Documentation

◆ value_type

See result::value_type.

Definition at line 698 of file result.hpp.

Member Function Documentation

◆ operator*() [1/3]

template<typename TSelf , typename TValue >
value_type & jsonv::result_value_operations< TSelf, TValue >::operator* ( ) &
inline

Definition at line 737 of file result.hpp.

◆ operator*() [2/3]

template<typename TSelf , typename TValue >
value_type && jsonv::result_value_operations< TSelf, TValue >::operator* ( ) &&
inline

Definition at line 738 of file result.hpp.

◆ operator*() [3/3]

template<typename TSelf , typename TValue >
const value_type & jsonv::result_value_operations< TSelf, TValue >::operator* ( ) const &
inline

Get the value inside of this result if it is result_state::ok.

Exceptions
bad_result_accessif state is not result_state::ok.

Definition at line 736 of file result.hpp.

◆ operator->() [1/2]

Definition at line 746 of file result.hpp.

◆ operator->() [2/2]

template<typename TSelf , typename TValue >
const value_type * jsonv::result_value_operations< TSelf, TValue >::operator-> ( ) const
inline

Get a pointer to the value inside of this result if it is result_state::ok.

Exceptions
bad_result_accessif state is not result_state::ok.

Definition at line 745 of file result.hpp.

◆ value() [1/3]

Definition at line 705 of file result.hpp.

◆ value() [2/3]

Definition at line 706 of file result.hpp.

◆ value() [3/3]

Get the value inside of this result if it is result_state::ok.

Exceptions
bad_result_accessif state is not result_state::ok.

Definition at line 704 of file result.hpp.

◆ value_or() [1/2]

template<typename TSelf , typename TValue >
template<typename UValue >
constexpr value_type jsonv::result_value_operations< TSelf, TValue >::value_or ( UValue &&  recovery_value) &&
inlineconstexprnoexcept

Definition at line 722 of file result.hpp.

◆ value_or() [2/2]

template<typename TSelf , typename TValue >
template<typename UValue >
constexpr value_type jsonv::result_value_operations< TSelf, TValue >::value_or ( UValue &&  recovery_value) const &
inlineconstexprnoexcept

Get the value inside of this result if it is result_state::ok and returns recovery_value in other cases.

Definition at line 712 of file result.hpp.


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