ericniebler / range-v3

Range library for C++14/17/20, basis for C++20's std::ranges
Other
4.05k stars 437 forks source link

pipe adaptor support for tuple_algorithm.hpp #1808

Open haleyk10198 opened 5 months ago

haleyk10198 commented 5 months ago

Hi,

I am aware of tuples are, will, and should never be considered as a view #1247 .

I am also most thankful of the utilities provided in <utility/tuple_algorithm.hpp>, namely the tuple transform / apply / fold / for_each. To my understanding, since pipe operator support comes from view_adaptor, the utilities don't come with fluent syntax, i.e.

ranges::tuple_for_each(std::tuple{1, 2, "3"}, std::identity {}); // OK
std::tuple{1, 2, "3"} | ranges::tuple_for_each(std::identity {}); // ERROR -- no pipe!

I am curious if it is possible for one to implement a tuple_adaptor concept, or what's the fundamental gap that led us to the point where the library ( and the std ) only support view_adaptor instead of exposing a more general T_adaptor concept

Thanks in advance