   reverse insertion into a vector
  From my understanding, the std::vector<> insert()   method does not accept a reverse_iterator in place of an iterator. However, this comes as quite an inconvienience to me, because in order to have my code working efficiently, I need the ability to insert elements after the element referenced by the reverse iterator. Are there any known workarounds to this problem?Thanks in advance 
  Btw, I ran a search for my problem using the search link earlier, and found someone asking a similar question to this, however I didn''t quite understand the advice that was given to him. ;  Why won''t std::vector::insert() accept reverse_iterator?It is a templated member function of std::vector (from MSDN): template<class InputIterator>   void insert( iterator _Where, InputIterator _First, InputIterator _Last   ); Where InputIterator needs to implement operator++.reverser_iterator fulfills that requirement nicely.The following program compiles and runs, with the expected result (VS.NET 2003). #include <vector>#include <iostream>int main(void)    {    std::vector<int> v;    std::vector<int> w;    v.push_back(0);    v.push_back(1);    v.push_back(2);    w.insert(w.begin(), v.rbegin(), v.rend());    std::cout << v[0] << '','' << v[1] << '','' << v[2] << std::endl;    std::cout << w[0] << '','' << w[1] << '','' << w[2] << std::endl;    return 0;    }// end of main  Kami no Itte ga ore ni zettai naru! ;  He wants to use a reverse_iterator as the insertion point - the first parameter, which is of type iterator.Solution: use the reverse_iterator's base() member function.Note: r_itor.base() points to the element that follows  r_itor (in the 'normal' order), which, for insert(), does the right thing. r_itor v   1 | 2 | 3 | 4 | 5 ^r_itor.base()w.insert( r_itor.base(), itor2, itor3 );  [edited by - Fruny on December 18, 2003 11:34:42 AM];  My apologies.  I read the original post too fast and missed it.   Kami no Itte ga ore ni zettai naru! ;  Thanks again guys, you were very helpful =P 