diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-06-10 13:49:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-10 13:49:15 +0200 |
commit | ab128e03ff555a8fc292352b0b21fc1075a4c008 (patch) | |
tree | 41c610f0168cf67abd93d63df7f80e7e9df8d4ba /src/script/cpp_api | |
parent | 9c497aa71f4678f7a8adcfedd37b73c5391d97ec (diff) | |
download | minetest-ab128e03ff555a8fc292352b0b21fc1075a4c008.tar.gz minetest-ab128e03ff555a8fc292352b0b21fc1075a4c008.tar.bz2 minetest-ab128e03ff555a8fc292352b0b21fc1075a4c008.zip |
C++11 patchset 6: forbid object copy using assigment/copy function deleters (#5945)
C++11 implement function deleting, it's generally used to prevent some object copy
In script API use this function removal on ScriptApiBase instead of ScriptApiClient/Server/MainMenu, this affect all ScriptApis
Move DISABLE_CLASS_COPY with constructor, the deleted function permit to replace function in its original place
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r-- | src/script/cpp_api/s_base.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/cpp_api/s_base.h b/src/script/cpp_api/s_base.h index e0f6b23ae..eda4e73ac 100644 --- a/src/script/cpp_api/s_base.h +++ b/src/script/cpp_api/s_base.h @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <iostream> #include <string> +#include "util/basic_macros.h" extern "C" { #include <lua.h> @@ -66,6 +67,7 @@ class ScriptApiBase { public: ScriptApiBase(); virtual ~ScriptApiBase(); + DISABLE_CLASS_COPY(ScriptApiBase); // These throw a ModError on failure void loadMod(const std::string &script_path, const std::string &mod_name); |