Open ldionne opened 9 years ago
My first reaction is that we shouldn't have a view::unique_by
, because view::adjacent_remove_if
should be an overload of view::unique
's operator()
that accepts predicate and projection arguments.
I think you guys have a view::group_by
, right? If so, maybe a view::group
or view::grouped
with an overload taking a predicate would also be more consistent/complete.
Also, I personally prefer having a different *_by
algorithm, but that's really just my own taste.
I was thinking that group_by
was misnamed. Since it takes a binary predicate, it should probably be called group_if
. Then group
would use equality, and group_by
would take a (unary) projection. But then again, maybe just group
(takes an optional predicate and projection) and group_by
(that takes just a projection) would do. Either way, group_by
should probably change.
While quickly skimming through the documentation, it occurred to me that
view::adjacent_remove_if
seems to do what aunique_by
view might do. It is basically aview::unique
but with a custom predicate. Thoughts?