title: std::copy from vector's position to vector's position
body: <p>This probably me being extremely tired, but I can't figure out how to copy part of a vector into a new vector. </p>
  
  <p>What I am trying to do, is find inside an std::vector (where char is typedefed as byte) where the starting tag is, and copy the data from there, up to the closing tag (which is at the end, and is 7 chars long).</p>
  
  <pre><code>typedef char byte;
  std::vector&lt;byte&gt; imagebytes;
  std::vector&lt;byte&gt; bytearray_;
  
  for ( unsigned int i = 0; i &lt; bytearray_.size(); i++ )
  {
      if ( (i + 5) &lt; (bytearray_.size()-7) )
      {
          std::string temp ( &amp;bytearray_[i], 5 );
  
          if ( temp == "&lt;IMG&gt;" )
          {
              // This is what isn't working
              std::copy( std::vector&lt;byte&gt;::iterator( bytearray_.begin() + i + 5 ),
                         std::vector&lt;byte&gt;::iterator( bytearray_.end() - 7 )
                         std::back_inserter( imagebytes) );
          }
      }   
  }
  </code></pre>
  
  <p>I know this loop looks horrible, I am open to suggestions!
  Please note, bytearray_ contains raw bytes of images, or audio files. Hence the vector.</p>