// Copyright (C) 2020 Jérôme Leclercq // This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #include namespace Nz { /*! * \ingroup core * \class Nz::MovablePtr * \brief Wraps a raw (non-proprietary) to allows it to be moved implicitly */ template MovablePtr::MovablePtr(T* value) : m_value(value) { } template MovablePtr::MovablePtr(MovablePtr&& ptr) noexcept : m_value(ptr.m_value) { ptr.m_value = nullptr; } template inline T* MovablePtr::Get() const { return m_value; } template T* MovablePtr::operator->() const { return m_value; } template MovablePtr::operator T*() const { return m_value; } template inline MovablePtr& MovablePtr::operator=(T* value) { m_value = value; return *this; } template MovablePtr& MovablePtr::operator=(MovablePtr&& ptr) noexcept { std::swap(m_value, ptr.m_value); return *this; } }