From 009a677e0dd459f5bb269042207eaa16c31b673e Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 22 Jan 2017 00:32:08 -0800 Subject: [PATCH] Use the STL's make_unique if available Fixes a build error with g++ 6.1 Fixes #3759 --- src/common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common.h b/src/common.h index ffd071d11..536f56aa3 100644 --- a/src/common.h +++ b/src/common.h @@ -644,11 +644,15 @@ wcstring vformat_string(const wchar_t *format, va_list va_orig); void append_format(wcstring &str, const wchar_t *format, ...); void append_formatv(wcstring &str, const wchar_t *format, va_list ap); +#ifdef __cpp_lib_make_unique +using std::make_unique; +#else /// make_unique implementation template std::unique_ptr make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } +#endif /// This functions returns the end of the quoted substring beginning at \c in. The type of quoting /// character is detemrined by examining \c in. Returns 0 on error.