summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-07-14 08:52:33 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-07-14 08:52:33 +0200
commit64d06e5f168ec498b2d5dda139263f56dfe9772d (patch)
tree39b0d8d153fd0e4957ad6e3c98f9ba6e47bf320b /include
parent1b08f129677c1109aae1fadc72ae68ebb7df7cb0 (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
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)...));
}