aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/almalloc.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/almalloc.h b/common/almalloc.h
index 26fa37ee..15d0263a 100644
--- a/common/almalloc.h
+++ b/common/almalloc.h
@@ -83,6 +83,13 @@ inline T* assume_aligned(T *ptr) noexcept
#endif
}
+/* std::make_unique was added with C++14, so until we rely on that, make our
+ * own version.
+ */
+template<typename T, typename ...ArgsT>
+std::unique_ptr<T> make_unique(ArgsT&&...args)
+{ return std::unique_ptr<T>{new T{std::forward<ArgsT>(args)...}}; }
+
} // namespace al
#endif /* AL_MALLOC_H */