Last change
on this file since 69 was
29,
checked in by landauf, 17 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
941 bytes
|
Line | |
---|
1 | // Copyright 2003 The Trustees of Indiana University. |
---|
2 | |
---|
3 | // Use, modification and distribution is subject to the Boost Software |
---|
4 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
---|
5 | // http://www.boost.org/LICENSE_1_0.txt) |
---|
6 | |
---|
7 | #include "boost/shared_container_iterator.hpp" |
---|
8 | #include "boost/shared_ptr.hpp" |
---|
9 | #include <algorithm> |
---|
10 | #include <iostream> |
---|
11 | #include <vector> |
---|
12 | |
---|
13 | typedef boost::shared_container_iterator< std::vector<int> > iterator; |
---|
14 | |
---|
15 | |
---|
16 | void set_range(iterator& i, iterator& end) { |
---|
17 | |
---|
18 | boost::shared_ptr< std::vector<int> > ints(new std::vector<int>()); |
---|
19 | |
---|
20 | ints->push_back(0); |
---|
21 | ints->push_back(1); |
---|
22 | ints->push_back(2); |
---|
23 | ints->push_back(3); |
---|
24 | ints->push_back(4); |
---|
25 | ints->push_back(5); |
---|
26 | |
---|
27 | i = iterator(ints->begin(),ints); |
---|
28 | end = iterator(ints->end(),ints); |
---|
29 | } |
---|
30 | |
---|
31 | |
---|
32 | int main() { |
---|
33 | |
---|
34 | iterator i,end; |
---|
35 | |
---|
36 | set_range(i,end); |
---|
37 | |
---|
38 | std::copy(i,end,std::ostream_iterator<int>(std::cout,",")); |
---|
39 | std::cout.put('\n'); |
---|
40 | |
---|
41 | return 0; |
---|
42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.