Hermes
|
Works just as std::optional, but supports GPU code. It may contain a value or not. More...
Public Member Functions | |
HERMES_DEVICE_CALLABLE | Optional () |
Default constructor. | |
HERMES_DEVICE_CALLABLE | Optional (const T &v) |
Value constructor. More... | |
HERMES_DEVICE_CALLABLE | Optional (T &&v) |
Move value constructor. More... | |
HERMES_DEVICE_CALLABLE | Optional (const Optional &other) |
Copy constructor. More... | |
HERMES_DEVICE_CALLABLE | Optional (Optional &&other) noexcept |
Move constructor. More... | |
HERMES_DEVICE_CALLABLE | operator bool () const |
Casts to bool (indicates whether this contains value) More... | |
HERMES_DEVICE_CALLABLE Optional & | operator= (const Optional &other) |
Copy assignment. More... | |
HERMES_DEVICE_CALLABLE Optional & | operator= (Optional &&other) noexcept |
Move assinment. More... | |
HERMES_DEVICE_CALLABLE Optional & | operator= (const T &v) |
Value assignment. More... | |
HERMES_DEVICE_CALLABLE Optional & | operator= (T &&v) |
Move value assignment. More... | |
HERMES_DEVICE_CALLABLE T * | operator-> () |
Gets value pointer. More... | |
HERMES_DEVICE_CALLABLE const T * | operator-> () const |
Gets const value pointer. More... | |
HERMES_DEVICE_CALLABLE T & | operator* () |
Gets value reference. More... | |
HERMES_DEVICE_CALLABLE const T & | operator* () const |
Gets value const reference. More... | |
HERMES_DEVICE_CALLABLE void | reset () |
Destroys stored value (if present) | |
HERMES_DEVICE_CALLABLE bool | hasValue () const |
Checks if this holds a value. More... | |
HERMES_DEVICE_CALLABLE T | valueOr (const T &v) const |
Gets value copy (if present) More... | |
HERMES_DEVICE_CALLABLE T & | value () |
Gets value's reference. More... | |
HERMES_DEVICE_CALLABLE const T & | value () const |
Gets value's const reference. More... | |
Works just as std::optional, but supports GPU code. It may contain a value or not.
T |
|
inlineexplicit |
Value constructor.
v |
|
inlineexplicit |
Move value constructor.
v |
|
inline |
Copy constructor.
other |
|
inlinenoexcept |
Move constructor.
other |
|
inline |
Checks if this holds a value.
|
inlineexplicit |
Casts to bool (indicates whether this contains value)
|
inline |
Gets value reference.
|
inline |
Gets value const reference.
|
inline |
Gets value pointer.
|
inline |
Gets const value pointer.
|
inline |
Copy assignment.
other |
|
inline |
Value assignment.
v |
|
inlinenoexcept |
Move assinment.
other |
|
inline |
Move value assignment.
v |
|
inline |
Gets value's reference.
|
inline |
Gets value's const reference.
|
inline |
Gets value copy (if present)
v | value returned in case of empty |