2 ms·
According to https://en.cppreference.com/w/cpp/ranges/filter_view https://en.cppreference.com/w/cpp/ranges/filter_view return value of views::filter is either a
by menaerus 2y ago
According to https://en.cppreference.com/w/cpp/ranges/filter_view https://en.cppreference.com/w/cpp/ranges/filter_view return value of views::filter is either a new ranges::view or some sort of range adaptor that seems to be equivalent to a ranges::filter_view.
I can only guess that it is those return values that are temporarily put on stack so that the consequent | operations could be chained. My hypothesis, without knowing much about this stuff, is that since the compiler cannot elide them (according to the godbolt link from the presentation), stack usage, as found by Google, has cubic growth. I don't quite understand why since I guess it's expected to grow linearly, e.g. 48 bytes at a time.