1 | //===----------------------------------------------------------------------===// |
2 | // |
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 |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | // UNSUPPORTED: c++03, c++11, c++14, c++17 |
10 | |
11 | // iterator, const_iterator, reverse_iterator, const_reverse_iterator |
12 | |
13 | #include <iterator> |
14 | #include <vector> |
15 | |
16 | #include "test_macros.h" |
17 | |
18 | using iterator = std::vector<bool>::iterator; |
19 | using const_iterator = std::vector<bool>::const_iterator; |
20 | using reverse_iterator = std::vector<bool>::reverse_iterator; |
21 | using const_reverse_iterator = std::vector<bool>::const_reverse_iterator; |
22 | using value_type = bool; |
23 | |
24 | static_assert( std::random_access_iterator<iterator>); |
25 | static_assert( std::random_access_iterator<reverse_iterator>); |
26 | static_assert(!std::contiguous_iterator<iterator>); |
27 | static_assert(!std::contiguous_iterator<reverse_iterator>); |
28 | #if TEST_STD_VER > 20 |
29 | static_assert( std::indirectly_writable<iterator, value_type>); |
30 | #else |
31 | static_assert(!std::indirectly_writable<iterator, value_type>); |
32 | #endif |
33 | static_assert( std::sentinel_for<iterator, iterator>); |
34 | static_assert( std::sentinel_for<iterator, const_iterator>); |
35 | static_assert(!std::sentinel_for<iterator, reverse_iterator>); |
36 | static_assert(!std::sentinel_for<iterator, const_reverse_iterator>); |
37 | static_assert( std::sized_sentinel_for<iterator, iterator>); |
38 | static_assert( std::sized_sentinel_for<iterator, const_iterator>); |
39 | static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>); |
40 | static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>); |
41 | static_assert(std::indirectly_movable<iterator, bool*>); |
42 | static_assert(std::indirectly_movable_storable<iterator, bool*>); |
43 | static_assert(std::indirectly_copyable<iterator, bool*>); |
44 | static_assert(std::indirectly_copyable_storable<iterator, bool*>); |
45 | static_assert(std::indirectly_swappable<iterator, iterator>); |
46 | |
47 | static_assert( std::random_access_iterator<const_iterator>); |
48 | static_assert( std::random_access_iterator<const_reverse_iterator>); |
49 | static_assert(!std::contiguous_iterator<const_iterator>); |
50 | static_assert(!std::contiguous_iterator<const_reverse_iterator>); |
51 | static_assert(!std::indirectly_writable<const_iterator, value_type>); |
52 | static_assert( std::sentinel_for<const_iterator, iterator>); |
53 | static_assert( std::sentinel_for<const_iterator, const_iterator>); |
54 | static_assert(!std::sentinel_for<const_iterator, reverse_iterator>); |
55 | static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>); |
56 | static_assert( std::sized_sentinel_for<const_iterator, iterator>); |
57 | static_assert( std::sized_sentinel_for<const_iterator, const_iterator>); |
58 | static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>); |
59 | static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>); |
60 | static_assert(!std::indirectly_swappable<const_iterator, const_iterator>); |
61 | |