ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
|
#include <acts/blob/master/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 219 of file Result.hpp.
View newest version in sPHENIX GitHub at line 219 of file Result.hpp
|
default |
Default constructor which initializes the result in the ok state.
The copy constructor is deleted.
Move constructor
other | The other result object, rvalue ref |
Definition at line 240 of file Result.hpp.
View newest version in sPHENIX GitHub at line 240 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 257 of file Result.hpp.
View newest version in sPHENIX GitHub at line 257 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 297 of file Result.hpp.
View newest version in sPHENIX GitHub at line 297 of file Result.hpp
|
inlinenoexcept |
Returns the error by-value.
res.ok()
this method will abort (noexcept) Definition at line 304 of file Result.hpp.
View newest version in sPHENIX GitHub at line 304 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 282 of file Result.hpp.
View newest version in sPHENIX GitHub at line 282 of file Result.hpp
|
inlinenoexcept |
Checks whether this result is in the ok state, and no error.
Definition at line 290 of file Result.hpp.
View newest version in sPHENIX GitHub at line 290 of file Result.hpp
|
default |
The (self) assignment operator is deleted.
|
inlinenoexcept |
Move assignment operator
other | The other result object, rvalue ref |
Definition at line 246 of file Result.hpp.
View newest version in sPHENIX GitHub at line 246 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 266 of file Result.hpp.
View newest version in sPHENIX GitHub at line 266 of file Result.hpp
Static factory function to initialize the result in the ok state.
Definition at line 275 of file Result.hpp.
View newest version in sPHENIX GitHub at line 275 of file Result.hpp
|
private |
Definition at line 307 of file Result.hpp.
View newest version in sPHENIX GitHub at line 307 of file Result.hpp
Referenced by operator=().