File tree Expand file tree Collapse file tree 4 files changed +55
-0
lines changed
Expand file tree Collapse file tree 4 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -714,6 +714,7 @@ set(files
714714 __ranges/enable_view.h
715715 __ranges/filter_view.h
716716 __ranges/from_range.h
717+ __ranges/indices_view.h
717718 __ranges/iota_view.h
718719 __ranges/istream_view.h
719720 __ranges/join_view.h
Original file line number Diff line number Diff line change 1+ // -*- C++ -*-
2+ // ===----------------------------------------------------------------------===//
3+ //
4+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+ // See https://llvm.org/LICENSE.txt for license information.
6+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+ //
8+ // ===----------------------------------------------------------------------===//
9+
10+ #ifndef _LIBCPP___RANGES_INDECES_VIEW_H
11+ #define _LIBCPP___RANGES_INDECES_VIEW_H
12+
13+ #include < __assert>
14+ #include < __config>
15+ #include < __iterator/concepts.h>
16+ #include < __ranges/iota_view.h>
17+
18+ #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19+ # pragma GCC system_header
20+ #endif
21+
22+ _LIBCPP_PUSH_MACROS
23+ #include < __undef_macros>
24+
25+ _LIBCPP_BEGIN_NAMESPACE_STD
26+
27+ #if _LIBCPP_STD_VER >= 26
28+
29+ namespace ranges {
30+
31+ namespace views {
32+
33+ inline constexpr auto indices = [](__integer_like auto __size) {
34+ return ranges::views::iota (decletype (__size), __size);
35+ };
36+
37+ inline namespace __cpo {
38+
39+ } // namespace __cpo
40+ } // namespace views
41+ } // namespace ranges
42+
43+ #endif // _LIBCPP_STD_VER >= 26
44+
45+ _LIBCPP_END_NAMESPACE_STD
46+
47+ _LIBCPP_POP_MACROS
48+
49+ #endif // _LIBCPP___RANGES_INDECES_VIEW_H
Original file line number Diff line number Diff line change @@ -1887,6 +1887,7 @@ module std [system] {
18871887 export std.functional.bind_back
18881888 }
18891889 module from_range { header "__ranges/from_range.h" }
1890+ module indices_view { header "__ranges/indices_view.h" }
18901891 module iota_view { header "__ranges/iota_view.h" }
18911892 module istream_view { header "__ranges/istream_view.h" }
18921893 module join_view { header "__ranges/join_view.h" }
Original file line number Diff line number Diff line change @@ -453,6 +453,10 @@ namespace std {
453453# include < __ranges/zip_view.h>
454454# endif
455455
456+ # if _LIBCPP_STD_VER >= 26
457+ # include < __ranges/indeces_view.h>
458+ # endif
459+
456460# include < version>
457461
458462// standard-mandated includes
You can’t perform that action at this time.
0 commit comments