title: const function inherited
body: <p>Suppose I have a base class foo</p>
  
  <pre><code>class foo {
      virtual int get() const = 0;
  }
  </code></pre>
  
  <p>and maybe 20 sub-classes foo_1, foo_2 ... inherited from foo and in the form of:</p>
  
  <pre><code>class foo_1 : public foo {
      int get() const { return 1; }
  }
  ...
  class foo_20 : public foo {
      int get() const { return 20; }
  }
  </code></pre>
  
  <p>Suddenly life is not so easy! I have a class foo_21, which has to do this:</p>
  
  <pre><code>class foo_21 : public foo {
      int get() { member_ = false; return 0; }
      bool member_;
  }
  </code></pre>
  
  <p>The problem is get is declared as const in the base class, and I have to change 
  something in the sub-class foo_21. How could I find a way to go around it?</p>