EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <acts/blob/sPHENIX/Core/include/Acts/Utilities/Result.hpp>
Public Member Functions | |
Result ()=default | |
Result (const Result< void, E > &other)=default | |
Result< void, E > & | operator= (const Result< void, E > &other)=default |
Result (Result< void, E > &&other) | |
Result< void, E > & | operator= (Result< void, E > &&other) noexcept |
template<typename E2 > | |
Result (E2 error) noexcept | |
template<typename E2 > | |
Result< void, E > & | operator= (E2 error) |
bool | ok () const noexcept |
E & | error ()&noexcept |
E | error ()&&noexcept |
Static Public Member Functions | |
static Result< void, E > | success () |
static Result< void, E > | failure (E error) |
Private Attributes | |
std::optional< E > | m_opt |
Template specialization for the void case. This specialization handles the case where there is no actual return value, but an error might be returned. Returning the error directly would make handling different from other functions using the Result<T, E>
mechanism. Result<void, E>
does not have the dereference operator, and value methods. The static success
factory does not accept a value.
Result<void, E>
is default constructible in the ok state, whereas Result<T, E>
is not. E | The type of the error |
Definition at line 220 of file Result.hpp.
View newest version in sPHENIX GitHub at line 220 of file Result.hpp
|
default |
Default constructor which initializes the result in the ok state.
|
default |
The copy constructor is deleted.
|
inline |
Move constructor
other | The other result object, rvalue ref |
Definition at line 241 of file Result.hpp.
View newest version in sPHENIX GitHub at line 241 of file Result.hpp
|
inlinenoexcept |
Constructor from error. This implicitly requires E2 to be convertible to E.
E2 | The type of the actual error |
error | The instance of the actual error |
Definition at line 258 of file Result.hpp.
View newest version in sPHENIX GitHub at line 258 of file Result.hpp
|
inlinenoexcept |
Returns a reference to the error stored in the result.
res.ok()
this method will abort (noexcept) Definition at line 298 of file Result.hpp.
View newest version in sPHENIX GitHub at line 298 of file Result.hpp
|
inlinenoexcept |
Returns the error by-value.
res.ok()
this method will abort (noexcept) Definition at line 305 of file Result.hpp.
View newest version in sPHENIX GitHub at line 305 of file Result.hpp
|
inlinestatic |
Static factory function to initialize the result in the error state.
error | The errorr to initialize with. |
Definition at line 283 of file Result.hpp.
View newest version in sPHENIX GitHub at line 283 of file Result.hpp
|
inlinenoexcept |
Checks whether this result is in the ok state, and no error.
Definition at line 291 of file Result.hpp.
View newest version in sPHENIX GitHub at line 291 of file Result.hpp
Referenced by pepsi_pdfinfo().
|
default |
The (self) assignment operator is deleted.
|
inlinenoexcept |
Move assignment operator
other | The other result object, rvalue ref |
Definition at line 247 of file Result.hpp.
View newest version in sPHENIX GitHub at line 247 of file Result.hpp
References m_opt.
|
inline |
Assignment operator from an error.
E2 | The type of the actual error |
error | The instance of the actual error |
Definition at line 267 of file Result.hpp.
View newest version in sPHENIX GitHub at line 267 of file Result.hpp
|
inlinestatic |
Static factory function to initialize the result in the ok state.
Definition at line 276 of file Result.hpp.
View newest version in sPHENIX GitHub at line 276 of file Result.hpp
|
private |
Definition at line 308 of file Result.hpp.
View newest version in sPHENIX GitHub at line 308 of file Result.hpp
Referenced by operator=().