title: Boost binary serialization problem with abstract class
body: <p>Ciao folks,</p>
  
  <p>I'm quiet desperate not to find the source of the problem. I'm using Boost:serialization (version 1.46.1) and everything was working fine with <code>binary_oarchive</code>. I have a hierarchy of classes and, thus, I use the <code>register_type()</code>. </p>
  
  <p>However, where I came to use <code>binary_iarchive</code> to unserialize my objects, I got </p>
  
  <blockquote>
    <p>error: cannot allocate an object of abstract type </p>
  </blockquote>
  
  <p>which comes from the call of <code>register_type()</code> on the input archive.</p>
  
  <p>After googling I found out that the macro <code>BOOST_SERIALIZATION_ASSUME_ABSTRACT(T)</code> must be used for the abstract classes. The problem is that it simply doesn't work :). 
  Can anyone help me out ?</p>
  
  <p>More about my code :</p>
  
  <pre><code>virtual void AbstractClass::initBinarySerialization(binary_iarchive&amp; ia)
          {
              ia.register_type&lt;AbstractClass&gt;();
          }
  
  virtual void SubClass::initBinarySerialization(binary_iarchive&amp; ia)
          {
              AbstractClass::initBinarySerialization(ia);
              ia.register_type&lt;SubClass&gt;();
          }
  </code></pre>
  
  <p>I call <code>initBinarySerialization</code> before reading in the archive. </p>