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

AliasDescription
using element_type = T

Properties

TypeNameDescription
bool operator<(const Ref& other) constnoexcept

Constructors

SignatureNameDescription
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)RefAdds 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

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) noexcept

operator=

C++
Ref& operator=(Ref&& other) noexcept

operator=

C++
template<typename U> Ref& operator=(const Ref<U>& other) noexcept

operator=

C++
template<typename U> Ref& operator=(Ref<U>&& other) noexcept

operator=

C++
Ref& operator=(std::nullptr_t) noexcept

operator*

C++
T& operator*() const

operator->

C++
T* operator->() const

Get

C++
T* Get() const

operatorbool

C++
explicit operator bool() const noexcept

IsValid

C++
bool IsValid() const noexcept

IsNull

C++
bool IsNull() const noexcept

Reset

C++
void Reset() noexcept

Swap

C++
void Swap(Ref& other) noexcept

CreateWeak

C++
WeakRef<T> CreateWeak() const

operator==

C++
bool operator==(const Ref& other) const noexcept

operator!=

C++
bool operator!=(const Ref& other) const noexcept

operator==

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

operator!=

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