title: Why is an assignment to a base class valid, but an assignment to a derived class a compilation error?
body: <p>This was an interview question. Consider the following:</p>
  
  <pre><code>struct A {}; 
  struct B : A {}; 
  A a; 
  B b; 
  a = b;
  b = a; 
  </code></pre>
  
  <p>Why does <code>b = a;</code> throw an error, while <code>a = b;</code> is perfectly fine? </p>