[libcxx-commits] [libcxx] WIP [libc++][ranges] P3060R3 Add std::views::indices(n) (PR #146823)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 4 00:03:30 PDT 2025


================
@@ -392,6 +392,16 @@ struct __fn {
 inline namespace __cpo {
 inline constexpr auto iota = __iota::__fn{};
 } // namespace __cpo
+
+
+#  if _LIBCPP_STD_VER >= 26
+
+inline constexpr auto indices = [](__integer_like auto __size) {
----------------
frederick-vs-ja wrote:

To be clear, I'm inclined to make the `operator()` static, see also #86052. I think this will improve performance in certain circumstances, but also accept non-portable (although harmless) calls on volatile-qualified values.

https://github.com/llvm/llvm-project/pull/146823


More information about the libcxx-commits mailing list