Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src
diff options
context:
space:
mode:
Commit23067c0e3a92d452c1f8f3519c64d970a27732e3 (patch)
Author
 martin dobrev <martindobrev0@gmail.com>
2018-09-07 18:59:05 +0300
Committer
 martin dobrev <martindobrev0@gmail.com>
2018-09-07 18:59:05 +0300
Filesdead42fc9ce6bad12dc2262370d9afef8ebf7aad /JSImpl/src
IPL-23067c0e3a92d452c1f8f3519c64d970a27732e3.tar
IPL-23067c0e3a92d452c1f8f3519c64d970a27732e3.tar.gz
IPL-23067c0e3a92d452c1f8f3519c64d970a27732e3.zip
Parentb37ef48f0dc109ef99089a99eb917d027799e5ea (diff)
Add enchance common types library
1 files changed, 12 insertions, 0 deletions
-rw-r--r--JSImpl/src/CommonTypes.h12
diff --git a/JSImpl/src/CommonTypes.h b/JSImpl/src/CommonTypes.h
index b3ceb0b..fb5ef2a 100644
--- a/JSImpl/src/CommonTypes.h
+++ b/JSImpl/src/CommonTypes.h
@@ -2,6 +2,7 @@
#include <string>
#include <vector>
#include <unordered_map>
+#include <memory>
template<typename T>
using IPLVector = std::vector<T>;
@@ -9,3 +10,14 @@ using IPLString = std::string;
template <typename Key, typename T>
using IPLUnorderedMap = std::unordered_map<Key, T>;
+
+template <typename T>
+using IPLSharedPtr = std::shared_ptr<T>;
+
+template <typename T, class... Args>
+inline IPLSharedPtr<T> IPLMakeSharePtr(Args&&... args) {
+ return std::make_shared<T, Args...>(args...);
+};
+
+template< typename T>
+using IPLEnableShared = std::enable_shared_from_this<T>;