c++ operator= method for const references
<p>I am writing class with a const reference like this:</p>

<pre><code>class B;

class foo {
  const B&amp; b;

  foo(const B&amp; newb): b(newb) { }

  void operator=(const foo &amp; foo2) {
      // This does not work
      foo.b = foo2.b;
  }   
};
</code></pre>

<p>I am trying to define a working operator= Obviously = does not work since I am not allowd to change a const reference. This there a way to let a reference point to another object?</p>

<p>If b is not const c++ will provide me with a working operator=. If I define one member as const cl will spit out:</p>

<p>warning C4512: 'foo' : assignment operator could not be generated</p>
