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

source code of libcxx/test/std/containers/views/views.span/span.iterators/iterator_concept_conformance.compile.pass.cpp