This documentation is archived and is not being maintained.

reverse_iterator Changes

Visual Studio .NET 2003

The names for some of the types defined by the Standard C++ Library reverse_iterator class have changed. Also, there are different template arguments for this class.

The following sample compiled in Visual C++ 6.0, but fails in the current version:

#include <iterator>
#include <vector>
typedef std::iterator<std::random_access_iterator_tag, char, int> random_it;

int main( )
{
   char c;
   
   // too many template args for VC7
   typedef std::reverse_iterator< random_it, char, char&, char *, int > rev_it; 
   rev_it::reference_type x = c;
   rev_it::pointer_type y = 0;
   rev_it::iter_type z;

   /*
   // try the following code instead
   typedef std::reverse_iterator< random_it > rev_it;
   rev_it::reference a = c;
   rev_it::pointer b = 0;
   rev_it::iterator_type c1;
   */
}

See Also

Breaking Changes in the Standard C++ Library

Show: