title: While checking vector size i get: 'Expression: vector subscript out of range'
body: <p>I have function that from vector of doubles (representing polynomial) generates vector of polynomials (vector of vectors of doubles). Then, I use this function in other function, it looks like this:</p>
  
  <pre><code>vector &lt; vector &lt;double&gt; &gt; lancuch_sturma ( vector &lt;double&gt; wielomian ) 
  {
          /* some code here */
  }
  </code></pre>
  
  <p>Next I have function that uses <code>lancuch_sturma</code>:</p>
  
  <pre><code>unsigned int ilosc_zmian_znaku (double x, vector &lt; vector &lt;double&gt; &gt; lancuch_sturma)
  {
      if (lancuch_sturma.size() == 0)
          return 0;
      else 
      {
          /* some code here */
      }   
  }
  </code></pre>
  
  <p>After that I have in <code>main()</code> a <code>vector &lt;double&gt; wielomian</code> filled with doubles. When I try to use it:</p>
  
  <pre><code>unsigned int test = ilosc_zmian_znaku (-2, lancuch_sturma(wielomian));
  </code></pre>
  
  <p>I get familiar error:</p>
  
  <blockquote>
    <hr>
    
    <h2>Microsoft Visual C++ Runtime Library</h2>
    
    <p>Debug Assertion Failed!</p>
    
    <p>Program: C:\Windows\system32\MSVCP110D.dll File: c:\program files
    (x86)\microsoft visual studio 11.0\vc\include\vector Line: 1140</p>
    
    <p>Expression: vector subscript out of range</p>
    
    <p>For information on how your program can cause an assertion failure,
    see the Visual C++ documentation on asserts.</p>
    
    <p>(Press Retry to debug the application)</p>
  </blockquote>
  
  <p>I get this error in  <code>ilosc_zmian_znaku</code>, in line where <code>if (lancuch_sturma.size() == 0)</code> is located, but I don't know what possibly gives that error. I put breakpoint there and I have my <code>lancuch_sturma</code> with <code>size=7</code>. To be exact:</p>
  
  <pre><code>-       lancuch_sturma  { size=7 }  std::vector&lt;std::vector&lt;double,std::allocator&lt;double&gt; &gt;,std::allocator&lt;std::vector&lt;double,std::allocator&lt;double&gt; &gt; &gt; &gt;
  </code></pre>
  
  <p>If <code>lancuch_sturma</code> have <code>size=7</code> then why I get error while checking if this size is <code>==0</code> ?</p>