forked from boostorg/iterator
little example
[SVN r598]
This commit is contained in:
14
example/reverse_iterator.cpp
Normal file
14
example/reverse_iterator.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
#include "boost/iterator/iterator_adaptors.hpp"
|
||||
#include "boost/cstdlib.hpp"
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
int x[] = { 1, 2, 3, 4 };
|
||||
boost::reverse_iterator<int*, int, int&, int*, std::random_access_iterator_tag, std::ptrdiff_t>
|
||||
first(x + 4), last(x);
|
||||
std::copy(first, last, std::ostream_iterator<int>(std::cout, " "));
|
||||
std::cout << std::endl;
|
||||
}
|
Reference in New Issue
Block a user