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, reverse_iterator |
12 | |
13 | #include <span> |
14 | |
15 | #include <iterator> |
16 | #include "test_macros.h" |
17 | |
18 | using iterator = std::span<int>::iterator; |
19 | using reverse_iterator = std::span<int>::reverse_iterator; |
20 | using value_type = int; |
21 | |
22 | static_assert(std::contiguous_iterator<iterator>); |
23 | LIBCPP_STATIC_ASSERT(std::__has_random_access_iterator_category<iterator>::value); |
24 | static_assert(std::indirectly_writable<iterator, value_type>); |
25 | static_assert(std::sentinel_for<iterator, iterator>); |
26 | static_assert(!std::sentinel_for<iterator, reverse_iterator>); |
27 | static_assert(std::sized_sentinel_for<iterator, iterator>); |
28 | static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>); |
29 | static_assert(std::indirectly_movable<iterator, int*>); |
30 | static_assert(std::indirectly_movable_storable<iterator, int*>); |
31 | static_assert(std::indirectly_copyable<iterator, int*>); |
32 | static_assert(std::indirectly_copyable_storable<iterator, int*>); |
33 | static_assert(std::indirectly_swappable<iterator, iterator>); |
34 | |