JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
jsonv::error< TError > Class Template Reference

A wrapper type for creating a result with result_state::error. More...

#include <jsonv/result.hpp>

Public Types

using error_type = TError
 

Public Member Functions

template<typename... TArgs>
constexpr error (TArgs &&... args) noexcept(std::is_nothrow_constructible_v< error_type, TArgs... >)
 
const error_typeget () const &
 
error_typeget () &
 
error_type && get () &&
 

Detailed Description

template<typename TError>
class jsonv::error< TError >

A wrapper type for creating a result with result_state::error.

It is implicitly convertible to any result with a convertible-to error_type.

{
return error("foo went bad");
}
An adapter for enumeration types.
A wrapper type for creating a result with result_state::error.
Definition result.hpp:626

Definition at line 625 of file result.hpp.

Member Typedef Documentation

◆ error_type

template<typename TError >
using jsonv::error< TError >::error_type = TError
See also
result::error_type

Definition at line 629 of file result.hpp.

Constructor & Destructor Documentation

◆ error()

template<typename TError >
template<typename... TArgs>
constexpr jsonv::error< TError >::error ( TArgs &&...  args)
inlineexplicitconstexprnoexcept

Definition at line 633 of file result.hpp.

Member Function Documentation

◆ get() [1/3]

template<typename TError >
error_type & jsonv::error< TError >::get ( ) &
inline

Definition at line 638 of file result.hpp.

◆ get() [2/3]

template<typename TError >
error_type && jsonv::error< TError >::get ( ) &&
inline

Definition at line 639 of file result.hpp.

◆ get() [3/3]

template<typename TError >
const error_type & jsonv::error< TError >::get ( ) const &
inline

Definition at line 637 of file result.hpp.


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