EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::Result< T, E > Class Template Reference

#include <acts/blob/sPHENIX/Core/include/Acts/Utilities/Result.hpp>

Public Member Functions

 Result ()=delete
 
 Result (const Result< T, E > &other)=delete
 
Result< T, E > & operator= (const Result< T, E > &other)=delete
 
 Result (Result< T, E > &&other)
 
Result< T, E > & operator= (Result< T, E > &&other)
 
template<typename T2 , typename _E = E, typename _T = T, typename = std::enable_if_t< (!std::is_same_v<_T, _E> && !std::is_constructible_v<_T, _E> && !std::is_convertible_v<_T, _E> && !std::is_constructible_v<_E, _T> && !std::is_convertible_v<_E, _T> && !(std::is_convertible_v<T2, _T> && std::is_convertible_v<T2, _E>))>>
 Result (T2 value) noexcept
 Constructor from arbitrary value This constructor allows construction from any value. This constructor is only enabled if T and E are unambiguous, meaning the cannot be implicitly converted and there is T cannot be constructed from E and vice-versa. This means that when this is invoked, the value can be propagated to the underlying variant, and the assignment will be correct, and error will be an error, and a value will be a value.
 

Private Member Functions

 Result (std::variant< T, E > &&var)
 

Detailed Description

template<typename T, typename E = std::error_code>
class Acts::Result< T, E >

Class which encapsulates either a valid result, or an error

Template Parameters
TThe valid result value
EThe error, defaults to std::error_code

Definition at line 26 of file Result.hpp.

View newest version in sPHENIX GitHub at line 26 of file Result.hpp

Constructor & Destructor Documentation

template<typename T, typename E = std::error_code>
Acts::Result< T, E >::Result ( std::variant< T, E > &&  var)
inlineprivate

Private constructor which accepts an external variant. This is used by the factory static methods to set up the variant unambiguously in all cases.

Definition at line 32 of file Result.hpp.

View newest version in sPHENIX GitHub at line 32 of file Result.hpp

template<typename T, typename E = std::error_code>
Acts::Result< T, E >::Result ( )
delete

Default construction is disallowed.

template<typename T, typename E = std::error_code>
Acts::Result< T, E >::Result ( const Result< T, E > &  other)
delete

Copy construction is disallowed

template<typename T, typename E = std::error_code>
Acts::Result< T, E >::Result ( Result< T, E > &&  other)
inline

Move construction is allowed

Definition at line 53 of file Result.hpp.

View newest version in sPHENIX GitHub at line 53 of file Result.hpp

template<typename T, typename E = std::error_code>
template<typename T2 , typename _E = E, typename _T = T, typename = std::enable_if_t< (!std::is_same_v<_T, _E> && !std::is_constructible_v<_T, _E> && !std::is_convertible_v<_T, _E> && !std::is_constructible_v<_E, _T> && !std::is_convertible_v<_E, _T> && !(std::is_convertible_v<T2, _T> && std::is_convertible_v<T2, _E>))>>
Acts::Result< T, E >::Result ( T2  value)
inlinenoexcept

Constructor from arbitrary value This constructor allows construction from any value. This constructor is only enabled if T and E are unambiguous, meaning the cannot be implicitly converted and there is T cannot be constructed from E and vice-versa. This means that when this is invoked, the value can be propagated to the underlying variant, and the assignment will be correct, and error will be an error, and a value will be a value.

Note
If T and E are ambigious, use the success and failure static factory methods.
Template Parameters
T2Type of the potential assignment
Parameters
valueThe potential value, could be an actual valid value or an error.

Definition at line 86 of file Result.hpp.

View newest version in sPHENIX GitHub at line 86 of file Result.hpp

Member Function Documentation

template<typename T, typename E = std::error_code>
Result<T, E>& Acts::Result< T, E >::operator= ( const Result< T, E > &  other)
delete

Assignment is disallowed

template<typename T, typename E = std::error_code>
Result<T, E>& Acts::Result< T, E >::operator= ( Result< T, E > &&  other)
inline

Move assignment is allowed

Parameters
otherThe other result instance, rvalue reference
Returns
The assigned instance

Definition at line 60 of file Result.hpp.

View newest version in sPHENIX GitHub at line 60 of file Result.hpp


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