Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Math/UnitConversion.inl |
Include |
#include "Math/UnitConversion.inl" |
template<typename ValueType, typename ErrorType>
class TValueOrError
Type used to return either a value or an error.
These must have a value or an error when newly constructed, but it is possible to have neither because of the functions to steal the value or error. This is critical for callers to consider since it means that HasValue() and HasError() must be checked independently; a return value of false from one does not imply that the other will return true.
The MakeValue and MakeError functions may be used to construct these conveniently.
Name | Description | |
---|---|---|
|
TValueOrError ( |
Construct the value from a proxy from MakeValue. |
|
TValueOrError ( |
Construct the error from a proxy from MakeError. |
Name | Description | ||
---|---|---|---|
|
ErrorType |
GetError() |
|
|
const ErrorT... |
GetError() |
|
|
ErrorType & |
GetError() |
Access the error. Asserts if this does not have an error. |
|
ValueType & |
GetValue() |
Access the value. Asserts if this does not have a value. |
|
ValueType |
GetValue() |
|
|
const ValueT... |
GetValue() |
|
|
HasError() |
Whether the error is set. |
|
|
HasValue() |
Whether the value is set. |
|
|
IsValid() |
Check whether a value is set. |
|
|
ErrorType |
StealError() |
Steal the error. Asserts if this does not have an error. This causes the error to be unset. |
|
ValueType |
StealValue() |
Steal the value. Asserts if this does not have a value. This causes the value to be unset. |
|
ErrorType &#... |
TryGetError() |
Access the error if it is set. |
|
const ErrorT... |
TryGetError() |
|
|
ValueType &#... |
TryGetValue() |
Access the value if it is set. |
|
const ValueT... |
TryGetValue() |