Hi everyone,
I would like to propose moving a small, specific subset of std::views from Banned to Allowed.
Background Historically, std::views and range adaptors were banned due to concerns regarding compile-time overhead, optimization difficulties, and the subjective readability issues of chaining with operator|.
However, since we recently deployed a Clang plugin that actively bans the use of operator| for range adaptors, the pipe syntax won't compile anyway. By relying on direct function call syntax (e.g., std::views::reverse(range)), we naturally discourage deeply nested chaining, which mitigates the worst compile-time hits and readability concerns.
Motivation Currently, we are reimplementing quite a bit of the standard view machinery directly in base. Specifically, we maintain base::Zip, base::Reversed, and base::RangeAsRvalues. It would be significantly easier and reduce our maintenance burden to just use the std::views equivalents directly.
Proposal
Update c++-features.md to explicitly allow the following specific views:
std::views::zip (to replace base::Zip)
std::views::reverse (to replace base::Reversed)
std::views::as_rvalue (to replace base::RangeAsRvalues)
Migrate existing usages of these base:: utilities to std::views:: and eventually deprecate the base:: versions.
If in the future folks find other utilities from <ranges> helpful, you are highly encouraged to propose them on the mailing list as separate proposals. For example, std::views::transform or std::views::enumerate also seem pretty useful.
Thoughts?
Best regards,
Jan
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CALB5StZ21Nx_Qc6Hye-9WLUry1yKVXNjWAkjqnRo-2%3DvQs0%2BRw%40mail.gmail.com.