forked from boostorg/iterator
merged from trunk
[SVN r21680]
This commit is contained in:
@ -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 ]
|
||||||
|
;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include <boost/iterator/iterator_adaptors.hpp>
|
#include <boost/iterator/reverse_iterator.hpp>
|
||||||
#include <boost/cstdlib.hpp>
|
#include <boost/cstdlib.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
@ -7,9 +7,7 @@
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int x[] = { 1, 2, 3, 4 };
|
int x[] = { 1, 2, 3, 4 };
|
||||||
boost::reverse_iterator<int*, int, int&, int*,
|
boost::reverse_iterator<int*> first(x + 4), last(x);
|
||||||
boost::iterator_tag<boost::mutable_lvalue_iterator_tag, boost::random_access_traversal_tag>
|
|
||||||
, std::ptrdiff_t> first(x + 4), last(x);
|
|
||||||
std::copy(first, last, std::ostream_iterator<int>(std::cout, " "));
|
std::copy(first, last, std::ostream_iterator<int>(std::cout, " "));
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user