Last change
on this file since 33 was
29,
checked in by landauf, 16 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
1.3 KB
|
Line | |
---|
1 | // Boost.Range library |
---|
2 | // |
---|
3 | // Copyright Thorsten Ottosen 2003-2004. Use, modification and |
---|
4 | // distribution is subject to the Boost Software License, Version |
---|
5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
---|
6 | // http://www.boost.org/LICENSE_1_0.txt) |
---|
7 | // |
---|
8 | // For more information, see http://www.boost.org/libs/range/ |
---|
9 | // |
---|
10 | |
---|
11 | #include <boost/static_assert.hpp> |
---|
12 | #include <boost/type_traits.hpp> |
---|
13 | #include <boost/config.hpp> |
---|
14 | |
---|
15 | enum Container {}; |
---|
16 | enum String {}; |
---|
17 | |
---|
18 | template< typename T > |
---|
19 | struct range_iterator; |
---|
20 | |
---|
21 | template<> |
---|
22 | struct range_iterator<Container> |
---|
23 | { |
---|
24 | template< typename C > |
---|
25 | struct pts |
---|
26 | { |
---|
27 | typedef BOOST_DEDUCED_TYPENAME C::iterator type; |
---|
28 | }; |
---|
29 | }; |
---|
30 | |
---|
31 | template<> |
---|
32 | struct range_iterator<String> |
---|
33 | { |
---|
34 | template< typename C > |
---|
35 | struct pts |
---|
36 | { |
---|
37 | typedef C type; |
---|
38 | }; |
---|
39 | }; |
---|
40 | |
---|
41 | template< typename C > |
---|
42 | class iterator_of |
---|
43 | { |
---|
44 | public: |
---|
45 | typedef range_iterator<Container>::BOOST_NESTED_TEMPLATE pts<C>::type type; |
---|
46 | }; |
---|
47 | |
---|
48 | #include <vector> |
---|
49 | |
---|
50 | void compat1() |
---|
51 | { |
---|
52 | std::vector<int> v; |
---|
53 | iterator_of< std::vector<int> >::type i = v.begin(); |
---|
54 | } |
---|
55 | |
---|
56 | #include <boost/test/included/unit_test_framework.hpp> |
---|
57 | |
---|
58 | using boost::unit_test_framework::test_suite; |
---|
59 | |
---|
60 | test_suite* init_unit_test_suite( int argc, char* argv[] ) |
---|
61 | { |
---|
62 | test_suite* test = BOOST_TEST_SUITE( "Range Test Suite" ); |
---|
63 | |
---|
64 | test->add( BOOST_TEST_CASE( &compat1 ) ); |
---|
65 | |
---|
66 | return test; |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | |
---|
Note: See
TracBrowser
for help on using the repository browser.