diff options
1 files changed, 12 insertions, 0 deletions
| -rw-r--r-- | JSImpl/src/CommonTypes.h | 12 |
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>; |
