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

Add adjacent_filter adaptor #119

Merged
merged 2 commits into from
Aug 14, 2023
Merged

Add adjacent_filter adaptor #119

merged 2 commits into from
Aug 14, 2023

Conversation

tcbrindle
Copy link
Owner

adjacent_filter() takes a binary predicate and has the same semantics as Range-V3's views::adjacent_filter: elements are tested pair-wise, and if the predicate returns false then the second element of the pair is discarded.

This also adds dedup() as a shortcut for adjacent_filter(std::not_equal_to{}), because that's what people are probably going to want most of the time.

Fixes #116

`adjacent_filter()` takes a binary predicate and has the same semantics as Range-V3's views::adjacent_filter: elements are tested pair-wise, and if the predicate returns `false` then the second element of the pair is discarded.

This also adds `dedup()` as a shortcut for `adjacent_filter(std::not_equal_to{})`, because that's what people are probably going to want most of the time.

Fixes #116
@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (979cb60) 97.58% compared to head (cf4ff91) 97.58%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #119   +/-   ##
=======================================
  Coverage   97.58%   97.58%           
=======================================
  Files          66       66           
  Lines        2280     2280           
=======================================
  Hits         2225     2225           
  Misses         55       55           
Files Changed Coverage Δ
include/flux/core/inline_sequence_base.hpp 91.66% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tcbrindle tcbrindle merged commit 856f34d into main Aug 14, 2023
25 checks passed
@tcbrindle tcbrindle deleted the pr/adjacent_filter branch December 8, 2023 16:53
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

Successfully merging this pull request may close these issues.

Add adjacent_remove_if (like) adaptor
1 participant