summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-05 14:03:55 +0100
committerGitHub <noreply@github.com>2021-03-05 14:03:55 +0100
commit868cd94ee9a5a0638c014a4cc42224f01ff234c8 (patch)
treecd23dc866f77de5b0b3e89a5eafeeb2ef24ffbdd /src/Globals.h
parentfixed the crash on generating in the SinglePiceStructuresGen (#5136) (diff)
downloadcuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.gz
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.bz2
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.lz
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.xz
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.tar.zst
cuberite-868cd94ee9a5a0638c014a4cc42224f01ff234c8.zip
Diffstat (limited to 'src/Globals.h')
-rw-r--r--src/Globals.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Globals.h b/src/Globals.h
index bc868b637..0a5607c2f 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -293,6 +293,12 @@ namespace cpp20
{
return std::unique_ptr<T>(new std::remove_extent_t<T>[a_Size]);
}
+
+ template <class T>
+ std::enable_if_t<!std::is_array_v<T>, std::unique_ptr<T>> make_unique_for_overwrite()
+ {
+ return std::unique_ptr<T>(new T);
+ }
}