LiteFX::asShared¶
Transfers a unique pointer to a shared pointer. The unique pointer will be released during this process.
Synopsis¶
Declared in <litefx/containers.hpp>
template<class T>
[[nodiscard]] constexpr SharedPtr<T> asShared(UniquePtr<T>&& ptr);
Return Value¶
A new shared pointer.
Note
The return value should not be discarded.
Template Parameters¶
| Name | Description |
|---|---|
| T | The type of the object, the pointer points to. |
Parameters¶
| Name | Description |
|---|---|
| ptr | The unique pointer that should be turned into a shared pointer. |