ionSmartPointer.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include "ionConfig.h"
12 
13 #include <memory>
14 
15 
17 template <typename T>
18 using UniquePointer = std::unique_ptr<T>;
19 
21 template <typename T>
22 using SharedPointer = std::shared_ptr<T>;
23 
25 template <typename T>
26 using WeakPointer = std::weak_ptr<T>;
27 
29 template <typename T>
30 static SharedPointer<T> SharedFromNew(T * const t)
31 {
32  return SharedPointer<T>(t);
33 }
34 
36 template <typename T, typename... Args>
37 static SharedPointer<T> MakeShared(Args&&... args)
38 {
39  return std::make_shared<T, Args...>(args...);
40 }
std::shared_ptr< T > SharedPointer
Definition: ionSmartPointer.h:22
std::weak_ptr< T > WeakPointer
Definition: ionSmartPointer.h:26
std::unique_ptr< T > UniquePointer
Definition: ionSmartPointer.h:18