1 // Copyright (C) 2004 Jeremy Siek <jsiek@cs.indiana.edu> 2 // Distributed under the Boost Software License, Version 1.0. (See 3 // accompanying file LICENSE_1_0.txt or copy at 4 // http://www.boost.org/LICENSE_1_0.txt) 5 6 #include <boost/iterator/reverse_iterator.hpp> 7 #include <boost/cstdlib.hpp> 8 #include <iostream> 9 #include <iterator> 10 #include <algorithm> 11 main()12int main() 13 { 14 int x[] = { 1, 2, 3, 4 }; 15 boost::reverse_iterator<int*> first(x + 4), last(x); 16 std::copy(first, last, std::ostream_iterator<int>(std::cout, " ")); 17 std::cout << std::endl; 18 return 0; 19 } 20