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 <map>
14
15#include <iterator>
16
17using iterator = std::map<int, int>::iterator;
18using const_iterator = std::map<int, int>::const_iterator;
19using reverse_iterator = std::map<int, int>::reverse_iterator;
20using const_reverse_iterator = std::map<int, int>::const_reverse_iterator;
21using value_type = std::pair<const int, int>;
22
23static_assert(std::bidirectional_iterator<iterator>);
24static_assert(!std::random_access_iterator<iterator>);
25static_assert(!std::indirectly_writable<iterator, value_type>);
26static_assert(std::sentinel_for<iterator, iterator>);
27static_assert(std::sentinel_for<iterator, const_iterator>);
28static_assert(!std::sentinel_for<iterator, reverse_iterator>);
29static_assert(!std::sentinel_for<iterator, const_reverse_iterator>);
30static_assert(!std::sized_sentinel_for<iterator, iterator>);
31static_assert(!std::sized_sentinel_for<iterator, const_iterator>);
32static_assert(!std::sized_sentinel_for<iterator, reverse_iterator>);
33static_assert(!std::sized_sentinel_for<iterator, const_reverse_iterator>);
34static_assert( std::indirectly_movable<iterator, std::pair<int, int>*>);
35static_assert(!std::indirectly_movable_storable<iterator, std::pair<int, int>*>);
36static_assert( std::indirectly_copyable<iterator, std::pair<int, int>*>);
37static_assert(!std::indirectly_copyable_storable<iterator, std::pair<int, int>*>);
38static_assert(!std::indirectly_swappable<iterator, iterator>);
39
40static_assert(std::bidirectional_iterator<const_iterator>);
41static_assert(!std::random_access_iterator<const_iterator>);
42static_assert(!std::indirectly_writable<const_iterator, value_type>);
43static_assert(std::sentinel_for<const_iterator, iterator>);
44static_assert(std::sentinel_for<const_iterator, const_iterator>);
45static_assert(!std::sentinel_for<const_iterator, reverse_iterator>);
46static_assert(!std::sentinel_for<const_iterator, const_reverse_iterator>);
47static_assert(!std::sized_sentinel_for<const_iterator, iterator>);
48static_assert(!std::sized_sentinel_for<const_iterator, const_iterator>);
49static_assert(!std::sized_sentinel_for<const_iterator, reverse_iterator>);
50static_assert(!std::sized_sentinel_for<const_iterator, const_reverse_iterator>);
51static_assert(!std::indirectly_swappable<const_iterator, const_iterator>);
52

source code of libcxx/test/std/containers/associative/map/iterator_concept_conformance.compile.pass.cpp