Consider the code:
std::vector a{3, 7, 8, 1, - 2, 4 };
auto view = a | std::views::take_while([](auto elem) {return elem > 0; });
Are there any standard means to get an iterator (or position) corresponding to the element of vector a following the last element entering the view, or can this be done only by tricks with lambda:
std::vector a{ 3, 7, 8, 11, -2, 4 };
auto it{ a.begin() };
auto lambda = [&it](auto elem)
{
bool result = (elem > 0);
if (result) ++it;
return result;
};
auto view = a | std::views::take_while(lambda);