Skip to content

LiteFX::SharedObject::create

Generic factory method used to create instances of the shared object.

Synopsis

Declared in <litefx/containers.hpp>

template<
    typename T,
    typename... TArgs>
requires std::derived_from<T, SharedObject>
[[nodiscard]] static SharedPtr<T> create(TArgs&&... args);

Return Value

A shared pointer of the shared object.

Note

The return value should not be discarded.

Template Parameters

NameDescription
TThe type of the class that inherits from SharedObject.
TArgsThe types of the arguments passed to the shared object's constructor.

Parameters

NameDescription
argsThe arguments that are forwarded to the shared object's constructor.

See Also

Allocator