Path: blob/main/contrib/llvm-project/libcxx/include/__fwd/subrange.h
35233 views
//===---------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===---------------------------------------------------------------------===//78#ifndef _LIBCPP___FWD_SUBRANGE_H9#define _LIBCPP___FWD_SUBRANGE_H1011#include <__concepts/copyable.h>12#include <__config>13#include <__iterator/concepts.h>14#include <cstddef>1516#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)17# pragma GCC system_header18#endif1920#if _LIBCPP_STD_VER >= 202122_LIBCPP_BEGIN_NAMESPACE_STD2324namespace ranges {2526enum class subrange_kind : bool { unsized, sized };2728template <input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent, subrange_kind _Kind>29requires(_Kind == subrange_kind::sized || !sized_sentinel_for<_Sent, _Iter>)30class _LIBCPP_TEMPLATE_VIS subrange;3132template <size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>33requires((_Index == 0 && copyable<_Iter>) || _Index == 1)34_LIBCPP_HIDE_FROM_ABI constexpr auto get(const subrange<_Iter, _Sent, _Kind>&);3536template <size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>37requires(_Index < 2)38_LIBCPP_HIDE_FROM_ABI constexpr auto get(subrange<_Iter, _Sent, _Kind>&&);3940} // namespace ranges4142using ranges::get;4344_LIBCPP_END_NAMESPACE_STD4546#endif // _LIBCPP_STD_VER >= 204748#endif // _LIBCPP___FWD_SUBRANGE_H495051