title: Input stream problem when using std::array
body: <p>When there is no <code>bool b</code> in <code>struct A</code>, the code works. When <code>bool b</code> is there, <code>ar &amp; mat</code> gives &quot;input stream error&quot; but registering elements of <code>std::array</code> one by one works. What's wrong here?</p>
  <pre><code>#include &lt;fstream&gt;
  #include &lt;boost/serialization/array.hpp&gt;
  #include &lt;boost/archive/text_oarchive.hpp&gt;
  #include &lt;boost/archive/text_iarchive.hpp&gt;
  
  struct A
  {
      std::array&lt;int, 3&gt; mat;
      bool b;
  
      template&lt;class Archive&gt; void serialize(Archive&amp; ar, const unsigned int version)
      {
          //ar &amp; mat[0];
          //ar &amp; mat[1];
          //ar &amp; mat[2];
          ar &amp; mat;
          ar &amp; b;
      }
  };
  
  
  int main()
  {
      {
          std::string fname = &quot;save.sr&quot;;
          std::ofstream ofs(fname);
          boost::archive::text_oarchive oa(ofs);
          A a;
          oa &lt;&lt; a;
      }
  
      {
          std::string fname = &quot;save.sr&quot;;
          std::ifstream ifs(fname);
          boost::archive::text_iarchive ia(ifs);
          A a;
          ia &gt;&gt; a;
      }
  
      return 0;
  }
  </code></pre>