17 constexpr C_AutoNode() noexcept: m_Ptr(
nullptr), m_Owned(false) {}
20 m_Ptr(another.m_Ptr), m_Owned(another.m_Owned) { another.m_Owned =
false; }
23 m_Ptr(
static_cast<T*
>(another.m_Ptr)), m_Owned(another.m_Owned) { another.m_Owned =
false; }
28 operator bool() const noexcept {
return m_Ptr !=
nullptr; }
30 operator T2*()
const noexcept {
return dynamic_cast<T2*
>(m_Ptr); }
38 T *
get() const noexcept {
return m_Ptr; }
39 bool owned() const noexcept {
return m_Owned; }
64 template<
class...T_Args>
114 const auto p = m_Ptr;
115 m_Ptr = another.m_Ptr;
118 const auto y = m_Owned;
119 m_Owned = another.m_Owned;
127 if (
auto ptr =
dynamic_cast<T*
>(another.
get()))
129 assign(ptr, another.m_Owned);
130 another.m_Owned =
false;
void operator=(C_AutoNode< T2 > &another)
constexpr C_AutoNode(T *p, bool owned) noexcept
void reset(T *ptr) noexcept
C_AutoNode(C_AutoNode< T2 > &another) noexcept
C_AutoNode(C_AutoNode &another) noexcept
bool owned() const noexcept
void operator=(C_AutoNode &another)
T ** operator&() noexcept
constexpr C_AutoNode() noexcept
bool takeOver(C_AutoNode< T2 > &another)
void swap(C_AutoNode &another) noexcept
void assign(T *ptr, bool owned)
T * operator->() const noexcept
T & operator*() const noexcept
constexpr C_NewNode(C_Void) noexcept
C_NewNode(T_Args &&...args)
THE common namespace of bux library.