title: How Can I new a value_type pointer?
body: <p>I am writing a serialize and deserialize method, and I encountered a problem in the implementation of <code>deserialize</code>: I can't <code>new</code> a <code>value_type</code>, which is actually a <code>Skill*</code>.</p>
  
  <pre><code>template &lt;class T &gt;
  static istream &amp;DeSerializePVector(istream&amp; istream_, T&amp; container)
  {
    typedef typename T::value_type ElementType;
    size_t size;
    istream_ &gt;&gt; size;
    container.reserve(size);
    container.resize(size);
  
    for(typename T::iterator ite = container.begin(); ite != container.end(); ite++)
    {
       *ite = new *ElementType;   //how can  I initialize this type?
       (*ite)-&gt;DeSerialize(istream_);
    }
  
    return istream_;
  }
  
  int main()
  {
      Skill*  disease = Factory::CreateSkill ( SKILLTYPE_DISEASE );
      Skill*  purify = Factory::CreateSkill ( SKILLTYPE_PURIFY );
      Skill* skills[2] = {disease, purify};
      vector&lt;Skill*&gt; int_vector = Tools::MakeVector ( skills );
      ofstream fileOut;
      fileOut.open ( "data.txt", std::ofstream::binary );
  
      ISerializable::SerializePVector( fileOut, int_vector );
      fileOut.flush();
      fileOut.close();
  
      ifstream fileIn;
      vector&lt;Skill*&gt; int_vector2;
      fileIn.open ( "data.txt", std::ofstream::binary );
      ISerializable::DeSerializePVector( fileIn, int_vector2 );
  }
  </code></pre>
  
  <p>How am I supposed to get this work?</p>