134 T& operator* ()
const {
return *m_val; }
135 T *operator->()
const {
return m_val; }
137 pointer() : m_val(NULL), m_x(NULL) { }
138 ~pointer() {
if (m_x) m_x->Unlock(); }
140 pointer(
const pointer& other)
141 : m_val(other.m_val), m_x(other.m_x) { m_x->Lock(); }
143 pointer& operator=(
const pointer& other)
145 if (m_x) m_x->Unlock();
152#if __cplusplus >= 201103L
153 pointer(pointer&& other) noexcept
154 : m_val(other.m_val), m_x(other.m_x)
160 pointer& operator=(pointer&& other)
noexcept
162 if (m_x) m_x->Unlock();
173 : m_val(val), m_x(latch) { m_x->Lock(); }
187 const T& operator* ()
const {
return *m_val; }
188 const T *operator->()
const {
return m_val; }
190 const_pointer() : m_val(NULL), m_s(NULL) { }
191 ~const_pointer() {
if (m_s) m_s->UnlockShared(); }
193 const_pointer(
const const_pointer& other)
194 : m_val(other.m_val), m_s(other.m_s) { m_s->LockShared(); }
196 const_pointer& operator=(
const const_pointer& other)
198 if (m_s) m_s->UnlockShared();
205#if __cplusplus >= 201103L
206 const_pointer(const_pointer&& other) noexcept
207 : m_val(other.m_val), m_s(other.m_s)
213 const_pointer& operator=(const_pointer&& other)
noexcept
215 if (m_s) m_s->UnlockShared();
225 const_pointer(
const T* val,
Lockable* latch)
226 : m_val(val), m_s(latch) { m_s->LockShared(); }