Logo
SharedPtr.h
1#pragma once
2
3namespace SharpKmyBase
4{
5 template<typename T>
6 public ref class SharedPtr
7 {
8 public:
10 m_ptr = new std::shared_ptr<T>();
11 }
12 void release() {
13 if (m_ptr)delete m_ptr;
14 m_ptr = nullptr;
15 }
16 std::shared_ptr<T>* m_ptr = nullptr;
17 operator bool()
18 {
19 return m_ptr != nullptr && m_ptr->get() != nullptr;
20 }
21 T* operator->() { return m_ptr->get(); }
22 std::shared_ptr<T>& operator* () { return *m_ptr; }
23 };
24}
Definition: SharedPtr.h:7
T * operator->()
Definition: SharedPtr.h:21
SharedPtr()
Definition: SharedPtr.h:9
void release()
Definition: SharedPtr.h:12
std::shared_ptr< T > * m_ptr
Definition: SharedPtr.h:16
std::shared_ptr< T > & operator*()
Definition: SharedPtr.h:22
Definition: Asset.cpp:6