|
| template<CUObject T, typename... Args> |
| T * | NewInit (FConstructObjectParameters &¶ms, Args &&... args) |
| | Create a new object which can also be initialized with an Initialize function if it has one. In case it has an Initialize function the args parameters should match them. This is an equivalent to the template Mcro::SharedObjects::MakeShareableInit.
|
| |
template<CFunctorObject Initializer, typename TArg = TFunction_Arg<Initializer, 0>, CUObject T = std::decay_t<TArg>>
requires std::is_lvalue_reference_v<TArg> |
| T * | ConstructObject (FConstructObjectParameters &¶ms, Initializer &&init) |
| | Equivalent to Mcro::Construct::Construct but for UObjects.
|
| |
template<CFunctorObject Initializer, typename... Args, typename TArg = TFunction_Arg<Initializer, 0>, CUObject T = std::decay_t<TArg>>
requires std::is_lvalue_reference_v<TArg> |
| T * | ConstructInit (FConstructObjectParameters &¶ms, Initializer &&init, Args &&... args) |
| | Equivalent to Mcro::Construct::Construct but for UObjects. If the constructed UObject type also has an Initialize function call that too after the lambda initializer. The args parameters should match the signature of Initialize in that case.
|
| |
template<CFunctorObject Initializer, typename... Args, typename TArg = TFunction_Arg<Initializer, 0>, CUObject T = std::decay_t<TArg>>
requires std::is_lvalue_reference_v<TArg>
Equivalent to Mcro::Construct::Construct but for UObjects. If the constructed UObject type also has an Initialize function call that too after the lambda initializer. The args parameters should match the signature of Initialize in that case.
Usage:
auto myObject = Construct({}, [](UMyObject& _)
{
_.Foo = 42;
_.Bar();
});
static_assert(std::is_same_v<decltype(myObject), UMyObject*>);
Notice how the object type is deduced from the argument of the initializer.
- Template Parameters
-
| Initializer | Initializer function type |
| Args | Arguments for the Initialize function |
- Parameters
-
| params | Parameters for every new object |
| init | A setup function for the newly created UObject |
| args | Arguments for the Initialize function |
- Returns
- The new object
Definition at line 211 of file Init.h.
template<CFunctorObject Initializer, typename TArg = TFunction_Arg<Initializer, 0>, CUObject T = std::decay_t<TArg>>
requires std::is_lvalue_reference_v<TArg>
Equivalent to Mcro::Construct::Construct but for UObjects.
Usage:
auto myObject = Construct({}, [](UMyObject& _)
{
_.Foo = 42;
_.Bar();
});
static_assert(std::is_same_v<decltype(myObject), UMyObject*>);
Notice how the object type is deduced from the argument of the initializer.
- Template Parameters
-
| Initializer | Initializer function type |
- Parameters
-
| params | Parameters for every new object |
| init | A setup function for the newly created UObject |
- Returns
- The new object
Definition at line 160 of file Init.h.