1 // Copyright (C) 2019-2022 Free Software Foundation, Inc.
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)
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.
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/>.
18 // { dg-options "-std=gnu++2a" }
19 // { dg-do compile { target c++2a } }
20 // { dg-require-normal-namespace "" }
23 #include "./synopsis_c++17.cc"
27 template<class> struct incrementable_traits
;
28 template<class> struct readable_traits
;
30 struct contiguous_iterator_tag
;
34 // These are function objects of unspecified type.
35 auto& _distance
= distance
;
36 auto& _advance
= advance
;
41 template<semiregular S
> class move_sentinel
;
43 template<input_or_output_iterator I
, sentinel_for
<I
> S
>
44 requires (!same_as
<I
, S
>) && copyable
<I
>
45 class common_iterator
;
47 template<class I
, class S
>
48 struct incrementable_traits
<common_iterator
<I
, S
>>;
50 template<input_iterator I
, class S
>
51 struct iterator_traits
<common_iterator
<I
, S
>>;
53 struct default_sentinel_t
;
55 template<input_or_output_iterator I
> class counted_iterator
;
58 struct incrementable_traits
<counted_iterator
<I
>>;
60 template<input_iterator I
>
61 requires same_as
<__detail::__iter_traits
<I
>, iterator_traits
<I
>>
62 struct iterator_traits
<counted_iterator
<I
>>;
64 struct unreachable_sentinel_t
;
68 template<> constexpr bool std::disable_sized_sentinel_for
<I
, I
> = true;
72 // customization points
73 constexpr auto* iter_move
= &std::ranges::iter_move
;
74 constexpr auto* iter_swap
= &std::ranges::iter_swap
;
76 constexpr bool const* disable_sized_sentinel_for
77 = &std::disable_sized_sentinel_for
<void, void>;
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
;