title: loading fstreams into a std::vector in c++
body: <p>This is a simple and complex question at the same time.</p>
  
  <p>This compiles:</p>
  
  <pre><code>int Test;
  vector&lt;int&gt; TEST;
  TEST.push_back(Test);
  cout &lt;&lt; TEST.size();
  </code></pre>
  
  <p>This does not compile:</p>
  
  <pre><code>fstream Test;
  vector&lt;fstream&gt; TEST;
  TEST.push_back(Test);
  cout &lt;&lt; TEST.size();
  </code></pre>
  
  <p>Is there any particular reason?
  Is there a way for me to get a dynamic list of fstreams?</p>
  
  <p>The error message:</p>
  
  <pre><code>1&gt;------ Build started: Project: vector_test, Configuration: Debug Win32 ------
  1&gt;  vector_test.cpp
  1&gt;c:\program files (x86)\microsoft visual studio 10.0\vc\include\fstream(1347): error C2248: 'std::basic_ios&lt;_Elem,_Traits&gt;::basic_ios' : cannot access private member declared in class 'std::basic_ios&lt;_Elem,_Traits&gt;'
  1&gt;          with
  1&gt;          [
  1&gt;              _Elem=char,
  1&gt;              _Traits=std::char_traits&lt;char&gt;
  1&gt;          ]
  1&gt;          c:\program files (x86)\microsoft visual studio 10.0\vc\include\ios(176) : see declaration of 'std::basic_ios&lt;_Elem,_Traits&gt;::basic_ios'
  1&gt;          with
  1&gt;          [
  1&gt;              _Elem=char,
  1&gt;              _Traits=std::char_traits&lt;char&gt;
  1&gt;          ]
  1&gt;          This diagnostic occurred in the compiler generated function 'std::basic_fstream&lt;_Elem,_Traits&gt;::basic_fstream(const std::basic_fstream&lt;_Elem,_Traits&gt; &amp;)'
  1&gt;          with
  1&gt;          [
  1&gt;              _Elem=char,
  1&gt;              _Traits=std::char_traits&lt;char&gt;
  1&gt;          ]
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>