Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

combining zug::drop_while and zug::last #32

Open
asa opened this issue Sep 1, 2022 · 0 comments
Open

combining zug::drop_while and zug::last #32

asa opened this issue Sep 1, 2022 · 0 comments

Comments

@asa
Copy link
Contributor

asa commented Sep 1, 2022

I have a usecase like:

auto meas = std::vector<pair<size_t, char>>{{0,"a"},{1,"b"},{2,"c"},{3,"d"}};
auto get_timestamps=zug::map([](auto x){
            auto [t,b] = x; 
            return t;
});
auto all_timestamps = meas | get_timestamps;
auto first_ts = all_timestamps | zug::first;
auto after_c = meas | zug::drop_while([first_ts](auto a){ return a.first<first_ts; });

In essence I want a zug::tupilified reduced value to show up in a drop_while test.

This way I have automatic creation of the reduced value to be used as a comparator. I can filter based on the result of some other tail of a transducer chain.

This is a bad example because it would just drop all meas, but assume that I could transduce down to a subset of the full meas and use its last value. I haven't been able to get a recipe that allows its use in something like drop_while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant