From 1529c82becde6afdbad6f57e6c24de0f85b4a9a3 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 21 May 2022 19:36:44 -0500 Subject: [PATCH] [nostalgia/core] Make AssetContainer non-copyable and non-movable --- src/nostalgia/core/assetmanager.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/nostalgia/core/assetmanager.hpp b/src/nostalgia/core/assetmanager.hpp index b25d736c..1bed2475 100644 --- a/src/nostalgia/core/assetmanager.hpp +++ b/src/nostalgia/core/assetmanager.hpp @@ -4,9 +4,9 @@ #pragma once -#include #include #include +#include #include #include @@ -18,22 +18,28 @@ template class AssetRef; template -struct AssetContainer { +class AssetContainer { friend AssetManager; friend AssetRef; + protected: + ox::Signal updated; + private: T m_obj; mutable int m_references = 0; public: - ox::Signal updated; - template explicit constexpr AssetContainer(Args&&... args): m_obj(ox::forward(args)...) { } + AssetContainer(AssetContainer&) = delete; + AssetContainer(AssetContainer&&) = delete; + AssetContainer& operator=(AssetContainer&) = delete; + AssetContainer& operator=(AssetContainer&&) = delete; + constexpr T *get() noexcept { return &m_obj; }