SafeCountable::m_count is mutable so that we can have safe_ptr<const T>
This commit is contained in:
parent
801f4e740c
commit
037210c70c
|
@ -116,11 +116,11 @@ public:
|
||||||
SafeCountable() : m_count(0) {}
|
SafeCountable() : m_count(0) {}
|
||||||
~SafeCountable() { assert(m_count == 0); }
|
~SafeCountable() { assert(m_count == 0); }
|
||||||
|
|
||||||
void inc_safe_count() { ++m_count; }
|
void inc_safe_count() const { ++m_count; }
|
||||||
void dec_safe_count() { --m_count; assert(m_count >= 0); }
|
void dec_safe_count() const { --m_count; assert(m_count >= 0); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_count;
|
mutable int m_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
// *** Containers helpers ***
|
// *** Containers helpers ***
|
||||||
|
|
Loading…
Reference in New Issue
Block a user