]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/config/test/boost_no_std_iterator.ipp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / config / test / boost_no_std_iterator.ipp
1 // (C) Copyright John Maddock 2001.
2 // Use, modification and distribution are subject to the
3 // Boost Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6 // See http://www.boost.org/libs/config for the most recent version.
7
8 // MACRO: BOOST_NO_STD_ITERATOR
9 // TITLE: std::iterator
10 // DESCRIPTION: The C++ implementation fails to provide the
11 // std::iterator class.
12
13 #include <iterator>
14 #include <stddef.h>
15
16 namespace boost_no_std_iterator{
17
18
19 int test()
20 {
21 typedef std::iterator<
22 std::random_access_iterator_tag,
23 int,
24 ptrdiff_t,
25 int*,
26 int&
27 > iterator_type;
28
29 iterator_type::value_type v = 0;
30 iterator_type::difference_type d = 0;
31 iterator_type::pointer p = &v;
32 iterator_type::reference r = v;
33 iterator_type::iterator_category cat;
34
35 typedef std::iterator<
36 std::random_access_iterator_tag,
37 int
38 > iterator_type_2;
39
40 iterator_type_2::value_type v2 = 0;
41 iterator_type_2::difference_type d2 = 0;
42 iterator_type_2::pointer p2 = &v2;
43 iterator_type_2::reference r2 = v2;
44 iterator_type_2::iterator_category cat2;
45 //
46 // suppress some warnings:
47 //
48 (void) &v;
49 (void) &d;
50 (void) &p;
51 (void) &r;
52 (void) &cat;
53
54 (void) &v2;
55 (void) &d2;
56 (void) &p2;
57 (void) &r2;
58 (void) &cat2;
59
60 return 0;
61 }
62
63 }
64
65
66
67