title: Boost.Serialize error for vector<complex>
body: <p>I am trying to use the default serialization facilities with boost, but I didn't manage to serialize a complex vector. I tried this:</p>
  
  <pre><code>#include &lt;fstream&gt;
  #include &lt;complex&gt;
  #include &lt;vector&gt;
  
  #include &lt;boost/archive/text_oarchive.hpp&gt;
  #include &lt;boost/serialization/vector.hpp&gt;
  #include &lt;boost/serialization/complex.hpp&gt;
  
  using namespace std;
  typedef complex&lt;double&gt; type;
  
  template&lt;class Archive&gt;
  void serialize(Archive&amp; ar, vector&lt;type&gt;&amp; objs, const unsigned version) {
      ar &amp; objs;
  }
  
  int main(){
      vector&lt;type&gt; r;
      r.push_back(1.3);
      r.push_back(12.12);
      r.push_back(-31.05);
  
      ofstream ofs("test.txt");
      boost::archive::text_oarchive oa(ofs);
      oa &amp; r;
      return 0;
  }
  </code></pre>
  
  <p>which compiles fine but crashes on execution. Yet if I do</p>
  
  <pre><code>typedef double type
  </code></pre>
  
  <p>then everything works OK. I can't figure out a solution for that. Any help?</p>
  
  <p>Thanks,</p>
  
  <p>Jan</p>