Hi,
I try to use const where ever appropriate.
In a collection class I am counting the iterators that are out. The
counter decrements when an iterator leaves scope or is 'Dispose( )'d
While iterators are around, any deleted item remains as NULL entry in
the inner std::list
This way I had to remove const from most of my member functions. Is is
good style to make the counter mutable to avoid this, since the counter
is not part of the main purpose of the class and its actual 'value'?
The same applies to reference counting on ordinary objects. I use
intrusive smart pointers, that increment and decrement a counter which
is in the object itself. I couldn't change the counters value if the
object is a const. Should the counter be mutable here?
thanks in advance