MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Mcro::SharedObjects::CSharedInitializeable Concept Reference

#include <SharedObjects.h>

Concept definition

template<typename T, typename... Args>
concept Mcro::SharedObjects::CSharedInitializeable = requires(T& object, Args&&... args)
{
object.Initialize(Forward<Args>(args)...);
}

Detailed Description

Concept describing an object which provides a deferred initializer for shared objects.

This works around the annoyance of TSharedFromThis objects cannot use their shared pointers in their constructor, braking RAII in some cases. Of course this is only achievable if the object cooperates and implements an Initialize method. It's important that Initialize should not be virtual so derived classes can hide them with their own overload.

Definition at line 46 of file SharedObjects.h.