From 037210c70c06f23ac8b17ff59cba0325b20529fb Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 12 Nov 2012 20:07:05 +0100 Subject: [PATCH] SafeCountable::m_count is mutable so that we can have safe_ptr --- src/utils.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.hh b/src/utils.hh index 73bd6276..b2c1847c 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -116,11 +116,11 @@ public: SafeCountable() : m_count(0) {} ~SafeCountable() { assert(m_count == 0); } - void inc_safe_count() { ++m_count; } - void dec_safe_count() { --m_count; assert(m_count >= 0); } + void inc_safe_count() const { ++m_count; } + void dec_safe_count() const { --m_count; assert(m_count >= 0); } private: - int m_count; + mutable int m_count; }; // *** Containers helpers ***