title: Pointers and References as member variables of const objects
body: <p>The following code compiles fine. However I wonder if it is legal C++. So more specific, if I have a const object, am I allowed to modify variables through pointers/references of that object?</p>
  
  <pre><code>class Foo {
  public:
      int* a;
      int&amp; b;
      Foo(int* _a, int&amp; _b) : a(_a), b(_b) {}
  };
  
  int main ( int argc, char* argv[] ) {
      int x = 7;
      const Foo bar(&amp;x, x);
  
      *bar.a = 3; //Leagal?
      bar.b = 7; //Legal?
      return 0;
  }
  </code></pre>