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 <array>
14
15#include <iterator>
16
17using iterator = std::array<int, 10>::iterator;
18using const_iterator = std::array<int, 10>::const_iterator;
19using reverse_iterator = std::array<int, 10>::reverse_iterator;
20using const_reverse_iterator = std::array<int, 10>::const_reverse_iterator;
21
22static_assert(std::contiguous_iterator<iterator>);
23static_assert(std::indirectly_writable<iterator, int>);
24static_assert(std::sentinel_for<iterator, iterator>);
25static_assert(std::sentinel_for<iterator, const_iterator>);
26static_assert(!std::sentinel_for<iterator, reverse_iterator>);
27static_assert(!std::sentinel_for<iterator, const_reverse_iterator>);
28static_assert(std::sized_sentinel_for<iterator, iterator>);
29static_assert(std::sized_sentinel_for<iterator, const_iterator>);
30static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
31static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
32static_assert( std::indirectly_movable<iterator, iterator>);
33static_assert( std::indirectly_movable_storable<iterator, iterator>);
34static_assert(!std::indirectly_movable<iterator, const_iterator>);
35static_assert(!std::indirectly_movable_storable<iterator, const_iterator>);
36static_assert( std::indirectly_movable<iterator, reverse_iterator>);
37static_assert( std::indirectly_movable_storable<iterator, reverse_iterator>);
38static_assert(!std::indirectly_movable<iterator, const_reverse_iterator>);
39static_assert(!std::indirectly_movable_storable<iterator, const_reverse_iterator>);
40static_assert( std::indirectly_copyable<iterator, iterator>);
41static_assert( std::indirectly_copyable_storable<iterator, iterator>);
42static_assert(!std::indirectly_copyable<iterator, const_iterator>);
43static_assert(!std::indirectly_copyable_storable<iterator, const_iterator>);
44static_assert( std::indirectly_copyable<iterator, reverse_iterator>);
45static_assert( std::indirectly_copyable_storable<iterator, reverse_iterator>);
46static_assert(!std::indirectly_copyable<iterator, const_reverse_iterator>);
47static_assert(!std::indirectly_copyable_storable<iterator, const_reverse_iterator>);
48static_assert( std::indirectly_swappable<iterator, iterator>);
49
50static_assert(std::contiguous_iterator<const_iterator>);
51static_assert(!std::indirectly_writable<const_iterator, int>);
52static_assert(std::sentinel_for<const_iterator, iterator>);
53static_assert(std::sentinel_for<const_iterator, const_iterator>);
54static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
55static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
56static_assert(std::sized_sentinel_for<const_iterator, iterator>);
57static_assert(std::sized_sentinel_for<const_iterator, const_iterator>);
58static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
59static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
60static_assert( std::indirectly_movable<const_iterator, iterator>);
61static_assert( std::indirectly_movable_storable<const_iterator, iterator>);
62static_assert(!std::indirectly_movable<const_iterator, const_iterator>);
63static_assert(!std::indirectly_movable_storable<const_iterator, const_iterator>);
64static_assert( std::indirectly_movable<const_iterator, reverse_iterator>);
65static_assert( std::indirectly_movable_storable<const_iterator, reverse_iterator>);
66static_assert(!std::indirectly_movable<const_iterator, const_reverse_iterator>);
67static_assert(!std::indirectly_movable_storable<const_iterator, const_reverse_iterator>);
68static_assert( std::indirectly_copyable<const_iterator, iterator>);
69static_assert( std::indirectly_copyable_storable<const_iterator, iterator>);
70static_assert(!std::indirectly_copyable<const_iterator, const_iterator>);
71static_assert(!std::indirectly_copyable_storable<const_iterator, const_iterator>);
72static_assert( std::indirectly_copyable<const_iterator, reverse_iterator>);
73static_assert( std::indirectly_copyable_storable<const_iterator, reverse_iterator>);
74static_assert(!std::indirectly_copyable<const_iterator, const_reverse_iterator>);
75static_assert(!std::indirectly_copyable_storable<const_iterator, const_reverse_iterator>);
76static_assert(!std::indirectly_swappable<const_iterator, const_iterator>);
77

source code of libcxx/test/std/containers/sequences/array/iterator_concept_conformance.compile.pass.cpp