class
TSharedPtr
Shared ownership, std::shared_ptr underneath
- Module
- Arc
- Header
#include "Arc/Core/ArcMemory.h"- Namespace
Arcf- Template
template<typename T>
Constructors
| Signature | Name | Description |
|---|---|---|
TSharedPtr() = default | TSharedPtr | |
TSharedPtr(std::nullptr_t) : m_ptr(nullptr) | TSharedPtr | |
explicit TSharedPtr(T* ptr) : m_ptr(ptr) | TSharedPtr | |
TSharedPtr(const TSharedPtr&) = default | TSharedPtr | |
TSharedPtr(TSharedPtr&&) noexcept = default | TSharedPtr | |
TSharedPtr(const std::shared_ptr<T>& ptr) : m_ptr(ptr) | TSharedPtr | Construct from std::shared_ptr (for interop with enable_shared_from_this) |
TSharedPtr(std::shared_ptr<T>&& ptr) noexcept : m_ptr(std::move(ptr)) | TSharedPtr | |
template<typename U, typename = std::enable_if_t<std::is_convertible_v<U*, T*>>>… | TSharedPtr | |
template<typename U, typename = std::enable_if_t<std::is_convertible_v<U*, T*>>>… | TSharedPtr |
Public functions
| Returns | Name | Description |
|---|---|---|
TSharedPtr& | operator= | |
TSharedPtr& | operator= | |
TSharedPtr& | operator= | |
T* | operator-> | |
T& | operator* | |
operatorbool | ||
T* | Get | |
void | Reset | |
bool | IsValid | |
long | GetRefCount | |
bool | operator== | |
bool | operator!= | |
bool | operator== | |
bool | operator!= |
Function details
TSharedPtr
C++
TSharedPtr() = defaultTSharedPtr
C++
TSharedPtr(std::nullptr_t) : m_ptr(nullptr)TSharedPtr
C++
explicit TSharedPtr(T* ptr) : m_ptr(ptr)TSharedPtr
C++
TSharedPtr(const TSharedPtr&) = defaultTSharedPtr
C++
TSharedPtr(TSharedPtr&&) noexcept = defaultTSharedPtr
C++
TSharedPtr(const std::shared_ptr<T>& ptr) : m_ptr(ptr)Construct from std::shared_ptr (for interop with enable_shared_from_this)
TSharedPtr
C++
TSharedPtr(std::shared_ptr<T>&& ptr) noexcept : m_ptr(std::move(ptr))TSharedPtr
C++
template<typename U, typename = std::enable_if_t<std::is_convertible_v<U*, T*>>> TSharedPtr(const TSharedPtr<U>& other) : m_ptr(other.m_ptr)TSharedPtr
C++
template<typename U, typename = std::enable_if_t<std::is_convertible_v<U*, T*>>> TSharedPtr(TSharedPtr<U>&& other) noexcept : m_ptr(std::move(other.m_ptr))operator=
C++
TSharedPtr& operator=(const TSharedPtr&) = defaultoperator=
C++
TSharedPtr& operator=(TSharedPtr&&) noexcept = defaultoperator=
C++
TSharedPtr& operator=(std::nullptr_t)operator->
C++
T* operator->() constoperator*
C++
T& operator*() constoperatorbool
C++
explicit operator bool() constGet
C++
T* Get() constReset
C++
void Reset()IsValid
C++
bool IsValid() constGetRefCount
C++
long GetRefCount() constoperator==
C++
bool operator==(const TSharedPtr& other) constoperator!=
C++
bool operator!=(const TSharedPtr& other) constoperator==
C++
bool operator==(std::nullptr_t) constoperator!=
C++
bool operator!=(std::nullptr_t) constGenerated from Arc/Core/ArcMemory.h via arc.json · Nov 5, 2026Version 1.0.0