1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef TEST_SUPPORT_ITERATOR_TRAITS_ITERATOR_TRAITS_CPP17_ITERATORS
10 #define TEST_SUPPORT_ITERATOR_TRAITS_ITERATOR_TRAITS_CPP17_ITERATORS
12 struct iterator_traits_cpp17_iterator
{
14 iterator_traits_cpp17_iterator
& operator++();
15 iterator_traits_cpp17_iterator
operator++(int);
18 struct iterator_traits_cpp17_proxy_iterator
{
20 iterator_traits_cpp17_proxy_iterator
& operator++();
22 // this returns legcay_iterator, not iterator_traits_cpp17_proxy_iterator
23 iterator_traits_cpp17_iterator
operator++(int);
26 struct iterator_traits_cpp17_input_iterator
{
27 using difference_type
= int;
28 using value_type
= long;
31 iterator_traits_cpp17_input_iterator
& operator++();
32 iterator_traits_cpp17_input_iterator
operator++(int);
34 bool operator==(iterator_traits_cpp17_input_iterator
const&) const;
37 struct iterator_traits_cpp17_proxy_input_iterator
{
38 using difference_type
= int;
39 using value_type
= long;
42 iterator_traits_cpp17_proxy_input_iterator
& operator++();
44 // this returns legcay_input_iterator, not iterator_traits_cpp17_proxy_input_iterator
45 iterator_traits_cpp17_input_iterator
operator++(int);
47 bool operator==(iterator_traits_cpp17_proxy_input_iterator
const&) const;
50 struct iterator_traits_cpp17_forward_iterator
{
51 using difference_type
= int;
52 using value_type
= int;
55 iterator_traits_cpp17_forward_iterator
& operator++();
56 iterator_traits_cpp17_forward_iterator
operator++(int);
58 bool operator==(iterator_traits_cpp17_forward_iterator
const&) const;
61 struct iterator_traits_cpp17_bidirectional_iterator
{
62 using difference_type
= int;
63 using value_type
= int;
66 iterator_traits_cpp17_bidirectional_iterator
& operator++();
67 iterator_traits_cpp17_bidirectional_iterator
operator++(int);
68 iterator_traits_cpp17_bidirectional_iterator
& operator--();
69 iterator_traits_cpp17_bidirectional_iterator
operator--(int);
71 bool operator==(iterator_traits_cpp17_bidirectional_iterator
const&) const;
74 struct iterator_traits_cpp17_random_access_iterator
{
75 using difference_type
= int;
76 using value_type
= int;
79 int& operator[](difference_type
);
80 iterator_traits_cpp17_random_access_iterator
& operator++();
81 iterator_traits_cpp17_random_access_iterator
operator++(int);
82 iterator_traits_cpp17_random_access_iterator
& operator--();
83 iterator_traits_cpp17_random_access_iterator
operator--(int);
85 bool operator==(iterator_traits_cpp17_random_access_iterator
const&) const;
86 bool operator<(iterator_traits_cpp17_random_access_iterator
const&) const;
87 bool operator>(iterator_traits_cpp17_random_access_iterator
const&) const;
88 bool operator<=(iterator_traits_cpp17_random_access_iterator
const&) const;
89 bool operator>=(iterator_traits_cpp17_random_access_iterator
const&) const;
91 iterator_traits_cpp17_random_access_iterator
& operator+=(difference_type
);
92 iterator_traits_cpp17_random_access_iterator
& operator-=(difference_type
);
94 friend iterator_traits_cpp17_random_access_iterator
operator+(iterator_traits_cpp17_random_access_iterator
,
96 friend iterator_traits_cpp17_random_access_iterator
operator+(difference_type
,
97 iterator_traits_cpp17_random_access_iterator
);
98 friend iterator_traits_cpp17_random_access_iterator
operator-(iterator_traits_cpp17_random_access_iterator
,
100 friend difference_type
operator-(iterator_traits_cpp17_random_access_iterator
,
101 iterator_traits_cpp17_random_access_iterator
);
104 #endif // TEST_SUPPORT_ITERATOR_TRAITS_ITERATOR_TRAITS_CPP17_ITERATORS