summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-07-14 08:52:33 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2019-01-17 17:03:42 +0100
commit8976d6f94b07c00274f0e7265729c3f90a3614b4 (patch)
tree0f0d7ba059cde75678607c68851f3535452a3c82 /include
parentd0b30d0bf08458cdb311324a8966bba8bf092890 (diff)
Fix o3tl::make_unique
...after 3f20471490c61b19fe4222f8c40df255051f6e3d "use std::unique_ptr in FlatFndBox: and extend o3tl::make_unique to cope with arrays" Change-Id: I17a07d0be677aa4a5427be4a5c2f05ed8b675726 (cherry picked from commit 64d06e5f168ec498b2d5dda139263f56dfe9772d)
Diffstat (limited to 'include')
-rw-r--r--include/o3tl/make_unique.hxx3
1 files changed, 2 insertions, 1 deletions
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)...));
}