From 60e87889d6438e386acf58c3967fb874af9aae82 Mon Sep 17 00:00:00 2001 From: mitchell Date: Sun, 5 Jan 2020 21:22:02 -0500 Subject: Added Sci::make_unique() and Sci::size() for better compatibility with the default branch. std::make_unique() is c++14 and std::size() is c++17. --- src/UniqueString.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/UniqueString.cxx') diff --git a/src/UniqueString.cxx b/src/UniqueString.cxx index cacc0a7d8..c4d616a10 100644 --- a/src/UniqueString.cxx +++ b/src/UniqueString.cxx @@ -21,8 +21,8 @@ UniqueString UniqueStringCopy(const char *text) { return UniqueString(); } const size_t len = strlen(text); - std::unique_ptr upcNew(new char[len + 1]); - memcpy(&upcNew[0], text, len + 1); + std::unique_ptr upcNew = Sci::make_unique(len + 1); + memcpy(upcNew.get(), text, len + 1); return UniqueString(upcNew.release()); } -- cgit v1.2.3