diff --git a/object.hpp b/object.hpp index f6e424c..9d33c4e 100644 --- a/object.hpp +++ b/object.hpp @@ -161,10 +161,10 @@ namespace cruft::vk { /////////////////////////////////////////////////////////////////////////// - template + template class owned_ptr { public: - owned_ptr (T &&_self, owner_t &_owner): + owned_ptr (SelfT &&_self, owner_t &_owner): m_self (std::move (_self)), m_owner (_owner) { ; } @@ -184,16 +184,19 @@ namespace cruft::vk { // justify the work. owned_ptr& operator= (owned_ptr &&rhs) = delete; - T& operator* ()& + const SelfT& get (void) const& { return m_self; } + SelfT& get (void)& { return m_self; } + + SelfT& operator* ()& { return m_self; } - T* + SelfT* operator-> ()& { return &m_self; } private: - T m_self; - owner_t &m_owner; + SelfT m_self; + owner_t &m_owner; };