[libcxx-commits] [libcxx] [libc++][test] Only `views::split(pattern)` can be piped (PR #74961)

S. B. Tam via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 9 19:34:44 PST 2023


cpplearner wrote:

It seems that libc++'s `decltype(std::views::split)` derives from `__range_adaptor_closure`, which provides `operator|`.

https://github.com/llvm/llvm-project/blob/b85f1f9b182234ba366d78ae2174a149e44d08c1/libcxx/include/__ranges/split_view.h#L195-L197

https://github.com/llvm/llvm-project/blob/b85f1f9b182234ba366d78ae2174a149e44d08c1/libcxx/include/__ranges/range_adaptor.h#L57-L63

I think `decltype(std::views::split)` should be like `decltype(std::views::take_while)`, which doesn't have a base class.

https://github.com/llvm/llvm-project/blob/b85f1f9b182234ba366d78ae2174a149e44d08c1/libcxx/include/__ranges/take_while_view.h#L134-L137

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


More information about the libcxx-commits mailing list