Original Post
I'm not a big fan of the 'mutable' storage class specifier. However, it seems inevitable, for example in a sort of stream base class.
Quote:Is there any clean way round it (while still maintaining the read() method to be declared 'const').
class Stream { virtual bool read(void* ptr, const int len) const { m_pointer += len; return true; } virtual bool write(const void* ptr, const int len) { m_pointer += len; return true; } mutable int pointer; // needs to be mutable to push the stream pointer in the read() method. };