ResultBase< T & > Class Template Reference

#include <resultbase.h>

Public Types

using ValueType = T &
 
using CopyType = T &
 
using MoveType = DummyParamType &
 
using DeleteType = typename std::decay< T >::type &&
 
template<typename T2 >
using ConstructibleFrom = std::enable_if< STD_IS_REPLACEMENT(same, T &, T2)||STD_IS_REPLACEMENT(same, typename std::remove_const< T >::type &, T2)>
 

Public Member Functions

 ResultBase ()
 
MAXON_IMPLICIT ResultBase (CopyType value)
 
MAXON_ATTRIBUTE_FORCE_INLINE T & GetValue () const
 
MAXON_ATTRIBUTE_FORCE_INLINE T & GetValueAndError (ThreadReferencedError &error) const
 
MAXON_ATTRIBUTE_FORCE_INLINE T & GetValueAndError (Error &error) const
 
MAXON_ATTRIBUTE_FORCE_INLINE const ThreadReferencedErrorGetErrorStorage () const
 
MAXON_ATTRIBUTE_FORCE_INLINE ThreadReferencedErrorGetErrorStorage ()
 
MAXON_ATTRIBUTE_FORCE_INLINE T & UncheckedGetValue () const
 
const Result< T * > & operator& () const
 

Static Public Attributes

static constexpr Bool HAS_ERROR
 

Protected Attributes

ThreadReferencedError _error
 
T * _value
 

Member Typedef Documentation

◆ ValueType

using ValueType = T&

◆ CopyType

using CopyType = T&

◆ MoveType

using MoveType = DummyParamType&

◆ DeleteType

using DeleteType = typename std::decay<T>::type&&

◆ ConstructibleFrom

using ConstructibleFrom = std::enable_if<STD_IS_REPLACEMENT(same, T&, T2) || STD_IS_REPLACEMENT(same, typename std::remove_const<T>::type&, T2)>

Constructor & Destructor Documentation

◆ ResultBase() [1/2]

◆ ResultBase() [2/2]

Member Function Documentation

◆ GetValue()

MAXON_ATTRIBUTE_FORCE_INLINE T& GetValue ( ) const

◆ GetValueAndError() [1/2]

MAXON_ATTRIBUTE_FORCE_INLINE T& GetValueAndError ( ThreadReferencedError error) const

◆ GetValueAndError() [2/2]

MAXON_ATTRIBUTE_FORCE_INLINE T& GetValueAndError ( Error &  error) const

◆ GetErrorStorage() [1/2]

MAXON_ATTRIBUTE_FORCE_INLINE const ThreadReferencedError& GetErrorStorage ( ) const

◆ GetErrorStorage() [2/2]

◆ UncheckedGetValue()

MAXON_ATTRIBUTE_FORCE_INLINE T& UncheckedGetValue ( ) const

◆ operator&()

const Result<T*>& operator& ( ) const

Converts from a Result<T&> to a Result<T*>.

Note
Usually it is a really bad idea to overload the address-of operator. But in this case it can't do any harm because ResultRef isn't used in contexts where the normal address-of operator is used. And if & was applied to a Result with the expectation of returning a pointer, the compiler would complain because Result doesn't mimic pointers at all.
Returns
This Result, cast to a Result<T*>.

Member Data Documentation

◆ HAS_ERROR

constexpr Bool HAS_ERROR
staticconstexpr

◆ _error

ThreadReferencedError _error
protected

◆ _value

T* _value
protected