![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
Ref-counting mixin, designed to add ref-counting to an object without requiring a virtual destructor. Implements support for AutoRTFM, is thread-safe by default, and can support custom deleters via T::StaticDestroyObject.
Basic Example: struct FMyRefCountedObject : public TRefCountingMixin<FMyRefCountedObject> { // ... };
Deleter Example: struct FMyRefCountedPooledObject : public TRefCountingMixin<FMyRefCountedPooledObject> { static void StaticDestroyObject(const FMyRefCountedPooledObject* Obj) { GPool->ReturnToPool(Obj); } };