summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ingen/types.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/ingen/types.hpp b/ingen/types.hpp
index 5e0d7506..98f700f5 100644
--- a/ingen/types.hpp
+++ b/ingen/types.hpp
@@ -57,6 +57,20 @@ SPtr<T> const_ptr_cast(const SPtr<U>& r) {
return std::const_pointer_cast<T>(r);
}
+template <typename T, typename... Args>
+std::unique_ptr<T>
+make_unique(Args&&... args)
+{
+ return std::unique_ptr<T>{new T{std::forward<Args>(args)...}};
+}
+
+template <typename T, typename... Args>
+std::shared_ptr<T>
+make_shared(Args&&... args)
+{
+ return std::make_shared<T>(std::forward<Args>(args)...);
+}
+
} // namespace ingen
#endif // INGEN_TYPES_HPP