From e284512d0dec979a127542d1e7c0b7d883ef8559 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 13 Sep 2017 16:51:52 +1000 Subject: [PATCH] object: rename T as SelfT for owned_ptr --- object.hpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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; };