From ef150f685116b2a90e6e651bd149c9af5ed5fb91 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Mon, 24 Jun 2019 16:21:47 +0200 Subject: [PATCH] Make internal storage of userdata non copyable or movable Signed-off-by: Deukhoofd --- src/UserData/UserDataStorage.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/UserData/UserDataStorage.hpp b/src/UserData/UserDataStorage.hpp index a3d741c..cb99ec6 100644 --- a/src/UserData/UserDataStorage.hpp +++ b/src/UserData/UserDataStorage.hpp @@ -8,6 +8,7 @@ namespace Porygon::UserData { class UserDataStorage { + private: class _internalDataStorage { public: std::unordered_map _userData; @@ -19,6 +20,11 @@ namespace Porygon::UserData { } _userData.clear(); } + + _internalDataStorage() = default; + _internalDataStorage( const UserDataStorage& ) = delete; // non construction-copyable + _internalDataStorage& operator=( const UserDataStorage& ) = delete; // non copyable + }; static _internalDataStorage _internal;