class

TSharedPtr

Shared ownership, std::shared_ptr underneath

Module
Arc
Header
#include "Arc/Core/ArcMemory.h"
Namespace
Arcf
Template
template<typename T>

Constructors

SignatureNameDescription
TSharedPtr() = defaultTSharedPtr
TSharedPtr(std::nullptr_t) : m_ptr(nullptr)TSharedPtr
explicit TSharedPtr(T* ptr) : m_ptr(ptr)TSharedPtr
TSharedPtr(const TSharedPtr&) = defaultTSharedPtr
TSharedPtr(TSharedPtr&&) noexcept = defaultTSharedPtr
TSharedPtr(const std::shared_ptr<T>& ptr) : m_ptr(ptr)TSharedPtrConstruct 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

ReturnsNameDescription
TSharedPtr&operator=
TSharedPtr&operator=
TSharedPtr&operator=
T*operator->
T&operator*
operatorbool
T*Get
voidReset
boolIsValid
longGetRefCount
booloperator==
booloperator!=
booloperator==
booloperator!=

Function details

TSharedPtr

C++
TSharedPtr() = default

TSharedPtr

C++
TSharedPtr(std::nullptr_t) : m_ptr(nullptr)

TSharedPtr

C++
explicit TSharedPtr(T* ptr) : m_ptr(ptr)

TSharedPtr

C++
TSharedPtr(const TSharedPtr&) = default

TSharedPtr

C++
TSharedPtr(TSharedPtr&&) noexcept = default

TSharedPtr

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&) = default

operator=

C++
TSharedPtr& operator=(TSharedPtr&&) noexcept = default

operator=

C++
TSharedPtr& operator=(std::nullptr_t)

operator->

C++
T* operator->() const

operator*

C++
T& operator*() const

operatorbool

C++
explicit operator bool() const

Get

C++
T* Get() const

Reset

C++
void Reset()

IsValid

C++
bool IsValid() const

GetRefCount

C++
long GetRefCount() const

operator==

C++
bool operator==(const TSharedPtr& other) const

operator!=

C++
bool operator!=(const TSharedPtr& other) const

operator==

C++
bool operator==(std::nullptr_t) const

operator!=

C++
bool operator!=(std::nullptr_t) const
Generated from Arc/Core/ArcMemory.h via arc.json · Nov 5, 2026Version 1.0.0