merged from trunk

[SVN r21680]
This commit is contained in:
Dave Abrahams
2004-01-13 15:45:17 +00:00
parent f05bfdccb7
commit 7b199b7b45
2 changed files with 15 additions and 5 deletions

View File

@ -1 +1,13 @@
unit-test ia1 : reverse_iterator.cpp : <sysinclude>../../.. <sysinclude>$(BOOST) ;
subproject libs/iterator/example ;
import testing ;
# Make tests run by default.
DEPENDS all : test ;
test-suite iterator_examples
: [ run reverse_iterator.cpp ]
[ run node_iterator1.cpp ]
[ run node_iterator2.cpp ]
[ run node_iterator3.cpp ]
;

View File

@ -1,4 +1,4 @@
#include <boost/iterator/iterator_adaptors.hpp>
#include <boost/iterator/reverse_iterator.hpp>
#include <boost/cstdlib.hpp>
#include <iostream>
#include <iterator>
@ -7,9 +7,7 @@
int main()
{
int x[] = { 1, 2, 3, 4 };
boost::reverse_iterator<int*, int, int&, int*,
boost::iterator_tag<boost::mutable_lvalue_iterator_tag, boost::random_access_traversal_tag>
, std::ptrdiff_t> first(x + 4), last(x);
boost::reverse_iterator<int*> first(x + 4), last(x);
std::copy(first, last, std::ostream_iterator<int>(std::cout, " "));
std::cout << std::endl;
return 0;