Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::clara::detail::ResultValueBase< T > Class Template Reference

#include <clara.hpp>

Inheritance diagram for Catch::clara::detail::ResultValueBase< T >:
Collaboration diagram for Catch::clara::detail::ResultValueBase< T >:

Public Member Functions

auto value () const -> T const &
 

Protected Member Functions

 ResultValueBase (Type type)
 
 ResultValueBase (ResultValueBase const &other)
 
 ResultValueBase (Type, T const &value)
 
auto operator= (ResultValueBase const &other) -> ResultValueBase &
 
 ~ResultValueBase () override
 
- Protected Member Functions inherited from Catch::clara::detail::ResultBase
 ResultBase (Type type)
 
virtual ~ResultBase ()=default
 
virtual void enforceOk () const =0
 

Protected Attributes

union { 
 
   T   m_value 
 
};  
 
- Protected Attributes inherited from Catch::clara::detail::ResultBase
Type m_type
 

Additional Inherited Members

- Public Types inherited from Catch::clara::detail::ResultBase
enum  Type { Ok , LogicError , RuntimeError }
 

Detailed Description

template<typename T>
class Catch::clara::detail::ResultValueBase< T >

Definition at line 536 of file clara.hpp.

Constructor & Destructor Documentation

◆ ResultValueBase() [1/3]

template<typename T >
Catch::clara::detail::ResultValueBase< T >::ResultValueBase ( Type type)
inlineprotected

Definition at line 544 of file clara.hpp.

544: ResultBase( type ) {}

◆ ResultValueBase() [2/3]

template<typename T >
Catch::clara::detail::ResultValueBase< T >::ResultValueBase ( ResultValueBase< T > const & other)
inlineprotected

Definition at line 546 of file clara.hpp.

546 : ResultBase( other ) {
547 if( m_type == ResultBase::Ok )
548 new( &m_value ) T( other.m_value );
549 }
#define T(meth, val, expected)

◆ ResultValueBase() [3/3]

template<typename T >
Catch::clara::detail::ResultValueBase< T >::ResultValueBase ( Type ,
T const & value )
inlineprotected

Definition at line 551 of file clara.hpp.

551 : ResultBase( Ok ) {
552 new( &m_value ) T( value );
553 }
auto value() const -> T const &
Definition clara.hpp:538
Here is the call graph for this function:

◆ ~ResultValueBase()

template<typename T >
Catch::clara::detail::ResultValueBase< T >::~ResultValueBase ( )
inlineoverrideprotected

Definition at line 564 of file clara.hpp.

564 {
565 if( m_type == Ok )
566 m_value.~T();
567 }

Member Function Documentation

◆ operator=()

template<typename T >
auto Catch::clara::detail::ResultValueBase< T >::operator= ( ResultValueBase< T > const & other) -> ResultValueBase &
inlineprotected

Definition at line 555 of file clara.hpp.

555 {
556 if( m_type == ResultBase::Ok )
557 m_value.~T();
558 ResultBase::operator=(other);
559 if( m_type == ResultBase::Ok )
560 new( &m_value ) T( other.m_value );
561 return *this;
562 }

◆ value()

template<typename T >
auto Catch::clara::detail::ResultValueBase< T >::value ( ) const -> T const &
inline

Definition at line 538 of file clara.hpp.

538 {
539 enforceOk();
540 return m_value;
541 }
virtual void enforceOk() const =0
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ [union]

◆ m_value

template<typename T >
T Catch::clara::detail::ResultValueBase< T >::m_value

Definition at line 570 of file clara.hpp.


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