class
Ref
Ref<T> — intrusive smart pointer for RefCounted objects. Like std::shared_ptr but the count lives in the object, so there is no separate control block.
- Module
- Core
- Header
#include "Core/Ref.h"- Namespace
Mowo- Template
template<typename T>
Type aliases
| Alias | Description |
|---|---|
using element_type = T |
Properties
| Type | Name | Description |
|---|---|---|
bool operator<(const Ref& other) const | noexcept |
Constructors
| Signature | Name | Description |
|---|---|---|
constexpr Ref() noexcept : m_ptr(nullptr) | Ref | |
constexpr Ref(std::nullptr_t) noexcept : m_ptr(nullptr) | Ref | |
explicit Ref(T* ptr) noexcept : m_ptr(ptr) | Ref | Adds a reference; it does not adopt the caller's. |
Ref(const Ref& other) noexcept : m_ptr(other.m_ptr) | Ref | |
Ref(Ref&& other) noexcept : m_ptr(other.m_ptr) | Ref | |
template<typename U> Ref(const Ref<U>& other) noexcept : m_ptr(other.Get()) | Ref | |
template<typename U> Ref(Ref<U>&& other) noexcept : m_ptr(other.Get()) | Ref | |
~Ref() | ~Ref |
Public functions
| Returns | Name | Description |
|---|---|---|
Ref& | operator= | |
Ref& | operator= | |
Ref& | operator= | |
Ref& | operator= | |
Ref& | operator= | |
T& | operator* | |
T* | operator-> | |
T* | Get | |
operatorbool | ||
bool | IsValid | |
bool | IsNull | |
void | Reset | |
void | Swap | |
WeakRef<T> | CreateWeak | |
bool | operator== | |
bool | operator!= | |
bool | operator== | |
bool | operator!= |
Function details
Ref
C++
constexpr Ref() noexcept : m_ptr(nullptr)Ref
C++
constexpr Ref(std::nullptr_t) noexcept : m_ptr(nullptr)Ref
C++
explicit Ref(T* ptr) noexcept : m_ptr(ptr)Adds a reference; it does not adopt the caller's.
Ref
C++
Ref(const Ref& other) noexcept : m_ptr(other.m_ptr)Ref
C++
Ref(Ref&& other) noexcept : m_ptr(other.m_ptr)Ref
C++
template<typename U> Ref(const Ref<U>& other) noexcept : m_ptr(other.Get())Ref
C++
template<typename U> Ref(Ref<U>&& other) noexcept : m_ptr(other.Get())~Ref
C++
~Ref()operator=
C++
Ref& operator=(const Ref& other) noexceptoperator=
C++
Ref& operator=(Ref&& other) noexceptoperator=
C++
template<typename U> Ref& operator=(const Ref<U>& other) noexceptoperator=
C++
template<typename U> Ref& operator=(Ref<U>&& other) noexceptoperator=
C++
Ref& operator=(std::nullptr_t) noexceptoperator*
C++
T& operator*() constoperator->
C++
T* operator->() constGet
C++
T* Get() constoperatorbool
C++
explicit operator bool() const noexceptIsValid
C++
bool IsValid() const noexceptIsNull
C++
bool IsNull() const noexceptReset
C++
void Reset() noexceptSwap
C++
void Swap(Ref& other) noexceptCreateWeak
C++
WeakRef<T> CreateWeak() constoperator==
C++
bool operator==(const Ref& other) const noexceptoperator!=
C++
bool operator!=(const Ref& other) const noexceptoperator==
C++
bool operator==(std::nullptr_t) const noexceptoperator!=
C++
bool operator!=(std::nullptr_t) const noexceptGenerated from Core/Ref.h via core.json · Nov 5, 2026Version 1.0.0