![]() |
MCRO
C++23 utilities for Unreal Engine.
|
Either a singular value of T, or a function returning T. It's very similar to TAttribute, however it doesn't rely on delegates, and has implicit conversions. TValueThunk owns its wrapped value. More...
#include <ValueThunk.h>
Public Types | |
| using | FunctionStorage = std::conditional_t<CCopyConstructible<T>, TFunction<T()>, TUniqueFunction<T()>> |
Public Member Functions | |
| template<CDefaultInitializable = T> | |
| TValueThunk () | |
| template<CCopyConstructible = T> | |
| TValueThunk (T const &value) | |
| template<CConvertibleTo< T > Other, CCopyConstructible = T> | |
| TValueThunk (TValueThunk< Other > const &other) | |
| template<CMoveConstructible = T> | |
| TValueThunk (T &&value) | |
| template<CMoveConstructible = T> | |
| TValueThunk (TValueThunk &&other) | |
| template<CFunctorObject Functor> requires CConvertibleTo<TFunction_ReturnDecay<Functor>, T> | |
| TValueThunk (Functor &&value, FValueThunkOptions const &options={}) | |
| T & | Get () |
| Evaluate the optional functor and get the cached result. | |
| T const & | Get () const |
| Evaluate the optional functor and get the cached result. | |
| T && | Steal () && |
| Evaluate the optional functor and move the cached result. | |
| T & | GetLast () |
| Get a cached/last result without calling the optional functor. | |
| T const & | GetLast () const |
| Get a cached/last result without calling the optional functor. | |
| T && | StealLast () && |
| Move a cached/last result without calling the optional functor. | |
| operator T& () | |
| operator T const & () const | |
| operator T&& () && | |
| bool | IsSet () const |
| template<CFunctorObject Functor> requires CConvertibleTo<TFunction_ReturnDecay<Functor>, T> | |
| TValueThunk & | operator= (Functor &&value) |
| template<CConvertibleTo< T > Other> requires (!CIsTemplate<Other, TValueThunk>) | |
| TValueThunk & | operator= (Other &&value) |
Friends | |
| template<typename Other > | |
| struct | TValueThunk |
Either a singular value of T, or a function returning T. It's very similar to TAttribute, however it doesn't rely on delegates, and has implicit conversions. TValueThunk owns its wrapped value.
Definition at line 41 of file ValueThunk.h.
| using Mcro::ValueThunk::TValueThunk< T >::FunctionStorage = std::conditional_t<CCopyConstructible<T>, TFunction<T()>, TUniqueFunction<T()>> |
Definition at line 46 of file ValueThunk.h.
|
inline |
Definition at line 49 of file ValueThunk.h.
|
inline |
Definition at line 52 of file ValueThunk.h.
|
inline |
Definition at line 55 of file ValueThunk.h.
|
inline |
Definition at line 64 of file ValueThunk.h.
|
inline |
Definition at line 67 of file ValueThunk.h.
|
inline |
Definition at line 77 of file ValueThunk.h.
|
inline |
Evaluate the optional functor and get the cached result.
Definition at line 94 of file ValueThunk.h.
|
inline |
Evaluate the optional functor and get the cached result.
Definition at line 97 of file ValueThunk.h.
|
inline |
Get a cached/last result without calling the optional functor.
Definition at line 103 of file ValueThunk.h.
|
inline |
Get a cached/last result without calling the optional functor.
Definition at line 106 of file ValueThunk.h.
|
inline |
Definition at line 115 of file ValueThunk.h.
|
inline |
Definition at line 112 of file ValueThunk.h.
|
inline |
Definition at line 111 of file ValueThunk.h.
|
inline |
Definition at line 113 of file ValueThunk.h.
|
inline |
Definition at line 119 of file ValueThunk.h.
|
inline |
Definition at line 128 of file ValueThunk.h.
|
inline |
Evaluate the optional functor and move the cached result.
Definition at line 100 of file ValueThunk.h.
|
inline |
Move a cached/last result without calling the optional functor.
Definition at line 109 of file ValueThunk.h.
Definition at line 44 of file ValueThunk.h.