title: Overloading operator= for structs, within classes
body: <p>We have the following:
  (pseudoish)</p>
  
  <pre><code>class MyClass
  {
      private:
         struct MyStruct{
            MyStruct operator=(const MyOtherStruct&amp; rhs);
            int am1;
            int am2;
         };
  };
  </code></pre>
  
  <p>We'd like to overload the <code>=</code> operator in the MyClass.cpp to do something like:</p>
  
  <pre><code>MyStruct&amp;
  MyStruct::operator=(const MyOtherStruct&amp; rhs)
  {
     am1 = rhs.am1;
     am2 = rhs.am2;
  }
  </code></pre>
  
  <p>However, it doesn't want to compile. We're getting an error similar to </p>
  
  <blockquote>
    <p>"missing ; before &amp;"</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>"MyStruct must be a class or namespace if followed by ::"</p>
  </blockquote>
  
  <p>Is there some concept here I'm missing?</p>