title: Creating stl vector from pair of iterator c++
body: <p>I am trying to create a stl vector from iterator pair and I am not sure how many elements the vector might have. It could have only one element. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  int main()
  {
      using namespace std;
  
      vector&lt;int&gt; vect;
      for (int nCount=0; nCount &lt; 6; nCount++)
          vect.push_back(nCount);
  
      vector&lt;int&gt; second(vect.begin(), vect.begin() );
  
      vector&lt;int&gt;::iterator it; // declare an read-only iterator
      it = second.begin(); // assign it to the start of the vector
  
      while (it != second.end()) // while it hasn't reach the end
      {
          cout &lt;&lt; *it &lt;&lt; " "; // print the value of the element it points to
          it++; // and iterate to the next element
      }
  
      cout &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I thought that vector 'second' would have one element pointed by vect.begin(). Is it not the case?</p>
  
  <p>Thanks</p>