24#ifndef MEMORY_REF_PTR_INCLUDED
25#define MEMORY_REF_PTR_INCLUDED
147 template <
typename R>
157 template <
typename R>
171 : m_underlying{rhs.m_underlying} {}
175 : m_underlying{rhs.m_underlying} {
181 this->m_underlying = &rhs;
194 this->m_underlying = rhs.m_underlying;
201 return this->m_underlying ==
nullptr;
206 return *this->m_underlying;
211 return this->m_underlying;
216 return this->m_underlying ==
nullptr;
221 return this->m_underlying !=
nullptr;
238 this->m_underlying =
nullptr;
Class that holds the pointer to a variable in a static and non-destructible way.
Definition: ref_ptr.h:46
bool operator==(std::nullptr_t rhs) const
Equality to nullptr operator.
Definition: ref_ptr.h:215
bool operator!=(std::nullptr_t rhs) const
Inequality to nullptr operator.
Definition: ref_ptr.h:220
Ref_ptr< T > & reset()
Resets the managed reference and stops managing any pointer.
Definition: ref_ptr.h:237
virtual ~Ref_ptr()=default
Default destructor.
T * m_underlying
The reference to be managed.
Definition: ref_ptr.h:162
T & operator*() const
Star operator to access the underlying object of type T.
Definition: ref_ptr.h:205
T * operator->() const
Arrow operator to access the underlying object of type T.
Definition: ref_ptr.h:210
Ref_ptr()=default
Default class constructor.
bool operator!() const
Negation operator.
Definition: ref_ptr.h:200
Ref_ptr< T > & operator=(T &rhs)
Assignment operator to instantiate the reference to be managed.
Definition: ref_ptr.h:180
Definition: aligned_atomic.h:44