// Copyright (C) 2021 Jérôme "Lynix" Leclercq (lynix680@gmail.com) // 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 { template MovableValue::MovableValue(T value) : m_value(std::move(value)) { } template MovableValue::MovableValue(MovableValue&& val) noexcept : m_value() { std::swap(m_value, val.m_value); } template T& MovableValue::Get() { return m_value; } template const T& MovableValue::Get() const { return m_value; } template MovableValue::operator T&() { return m_value; } template MovableValue::operator const T&() const { return m_value; } template MovableValue& MovableValue::operator=(T value) { m_value = std::move(value); return *this; } template MovableValue& MovableValue::operator=(MovableValue&& ptr) noexcept { std::swap(m_value, ptr.m_value); return *this; } }