[Libreoffice-commits] core.git: include/o3tl

Stephan Bergmann sbergman at redhat.com
Fri Jul 14 06:53:49 UTC 2017


 include/o3tl/make_unique.hxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 64d06e5f168ec498b2d5dda139263f56dfe9772d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 14 08:52:33 2017 +0200

    Fix o3tl::make_unique
    
    ...after 3f20471490c61b19fe4222f8c40df255051f6e3d "use std::unique_ptr in
    FlatFndBox: and extend o3tl::make_unique to cope with arrays"
    
    Change-Id: I17a07d0be677aa4a5427be4a5c2f05ed8b675726

diff --git a/include/o3tl/make_unique.hxx b/include/o3tl/make_unique.hxx
index 40658f5734d4..555e9ca538b8 100644
--- a/include/o3tl/make_unique.hxx
+++ b/include/o3tl/make_unique.hxx
@@ -23,7 +23,8 @@ namespace o3tl
  * Can be replaced by std::make_unique when we allow C++14.
  */
 template<typename T, typename... Args>
-typename std::unique_ptr<T> make_unique(Args&& ... args)
+typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
+make_unique(Args&& ... args)
 {
     return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
 }


More information about the Libreoffice-commits mailing list