diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-03-05 14:03:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-05 14:03:55 +0100 |
commit | 868cd94ee9a5a0638c014a4cc42224f01ff234c8 (patch) | |
tree | cd23dc866f77de5b0b3e89a5eafeeb2ef24ffbdd /src/Globals.h | |
parent | fixed the crash on generating in the SinglePiceStructuresGen (#5136) (diff) | |
download | cuberite-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.h | 6 |
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); + } } |