]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++20.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 24_iterators / headers / iterator / synopsis_c++20.cc
CommitLineData
83ffe9cd 1// Copyright (C) 2019-2023 Free Software Foundation, Inc.
6d0dff49
JW
2//
3// This file is part of the GNU ISO C++ Library. This library is free
4// software; you can redistribute it and/or modify it under the
5// terms of the GNU General Public License as published by the
6// Free Software Foundation; either version 3, or (at your option)
7// any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License along
15// with this library; see the file COPYING3. If not see
16// <http://www.gnu.org/licenses/>.
17
18// { dg-options "-std=gnu++2a" }
19// { dg-do compile { target c++2a } }
20// { dg-require-normal-namespace "" }
21
22#include <iterator>
23#include "./synopsis_c++17.cc"
24
25namespace std
26{
27 template<class> struct incrementable_traits;
28 template<class> struct readable_traits;
29
30 struct contiguous_iterator_tag;
31
32 namespace ranges
33 {
a49a045b
JW
34 // These are function objects of unspecified type.
35 auto& _distance = distance;
36 auto& _advance = advance;
37 auto& _next = next;
38 auto& _prev = prev;
6d0dff49
JW
39 }
40
41 template<semiregular S> class move_sentinel;
42
43 template<input_or_output_iterator I, sentinel_for<I> S>
1b425f3a 44 requires (!same_as<I, S>) && copyable<I>
6d0dff49
JW
45 class common_iterator;
46
47 template<class I, class S>
48 struct incrementable_traits<common_iterator<I, S>>;
49
50 template<input_iterator I, class S>
51 struct iterator_traits<common_iterator<I, S>>;
52
53 struct default_sentinel_t;
54
55 template<input_or_output_iterator I> class counted_iterator;
56
57 template<class I>
58 struct incrementable_traits<counted_iterator<I>>;
59
60 template<input_iterator I>
902b40c7 61 requires same_as<__detail::__iter_traits<I>, iterator_traits<I>>
6d0dff49
JW
62 struct iterator_traits<counted_iterator<I>>;
63
64 struct unreachable_sentinel_t;
65}
66
328b52d6 67struct I { };
d99828ee 68template<> constexpr bool std::disable_sized_sentinel_for<I, I> = true;
328b52d6 69
6d0dff49
JW
70namespace __gnu_test
71{
72 // customization points
73 constexpr auto* iter_move = &std::ranges::iter_move;
74 constexpr auto* iter_swap = &std::ranges::iter_swap;
75 // sized sentinels
d99828ee
JW
76 constexpr bool const* disable_sized_sentinel_for
77 = &std::disable_sized_sentinel_for<void, void>;
6d0dff49
JW
78 // default sentinels
79 constexpr std::default_sentinel_t const* default_sentinel
80 = &std::default_sentinel;
81 // unreachable sentinels
82 constexpr std::unreachable_sentinel_t const* unreachable_sentinel
83 = &std::unreachable_sentinel;
84}