xref: /freebsd/contrib/llvm-project/libcxx/include/__fwd/subrange.h (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
1*bdd1243dSDimitry Andric //===---------------------------------------------------------------------===//
2*bdd1243dSDimitry Andric //
3*bdd1243dSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*bdd1243dSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*bdd1243dSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*bdd1243dSDimitry Andric //
7*bdd1243dSDimitry Andric //===---------------------------------------------------------------------===//
8*bdd1243dSDimitry Andric 
9*bdd1243dSDimitry Andric #ifndef _LIBCPP___FWD_SUBRANGE_H
10*bdd1243dSDimitry Andric #define _LIBCPP___FWD_SUBRANGE_H
11*bdd1243dSDimitry Andric 
12*bdd1243dSDimitry Andric #include <__config>
13*bdd1243dSDimitry Andric 
14*bdd1243dSDimitry Andric #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15*bdd1243dSDimitry Andric #  pragma GCC system_header
16*bdd1243dSDimitry Andric #endif
17*bdd1243dSDimitry Andric 
18*bdd1243dSDimitry Andric #if _LIBCPP_STD_VER >= 20
19*bdd1243dSDimitry Andric 
20*bdd1243dSDimitry Andric #include <__iterator/concepts.h>
21*bdd1243dSDimitry Andric 
22*bdd1243dSDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD
23*bdd1243dSDimitry Andric 
24*bdd1243dSDimitry Andric namespace ranges {
25*bdd1243dSDimitry Andric 
26*bdd1243dSDimitry Andric enum class _LIBCPP_ENUM_VIS subrange_kind : bool { unsized, sized };
27*bdd1243dSDimitry Andric 
28*bdd1243dSDimitry Andric template <input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent, subrange_kind _Kind>
29*bdd1243dSDimitry Andric   requires(_Kind == subrange_kind::sized || !sized_sentinel_for<_Sent, _Iter>)
30*bdd1243dSDimitry Andric class _LIBCPP_TEMPLATE_VIS subrange;
31*bdd1243dSDimitry Andric 
32*bdd1243dSDimitry Andric } // namespace ranges
33*bdd1243dSDimitry Andric 
34*bdd1243dSDimitry Andric _LIBCPP_END_NAMESPACE_STD
35*bdd1243dSDimitry Andric 
36*bdd1243dSDimitry Andric #endif // _LIBCPP_STD_VER >= 20
37*bdd1243dSDimitry Andric 
38*bdd1243dSDimitry Andric #endif // _LIBCPP___FWD_SUBRANGE_H
39