aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--entityx/config.h.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/entityx/config.h.in b/entityx/config.h.in
index 2e6f000..940d4d1 100644
--- a/entityx/config.h.in
+++ b/entityx/config.h.in
@@ -17,6 +17,8 @@ static const uint64_t MAX_COMPONENTS = ENTITYX_MAX_COMPONENTS;
// Which shared_ptr implementation should we use?
#include <memory>
+// for std::forward()
+#include <utility>
namespace entityx {
@@ -35,6 +37,11 @@ using enable_shared_from_this = std::enable_shared_from_this<T>;
namespace entityx {
+template <typename T, typename... Args>
+ptr<T> make_ptr(Args&&... args) {
+ return ptr<T>(::new T(std::forward<Args>(args)...));
+}
+
template <typename T>
bool operator == (const weak_ptr<T> &a, const weak_ptr<T> &b) {
return a.lock() == b.lock();