2 Jun
2018
2 Jun
'18
7:54 p.m.
-----Original Message----- From: Boost
On Behalf Of Robert Ramey via Boost Sent: Saturday, June 2, 2018 9:36 PM [...]
template
auto range_adaptor(const C & c){ return F(c.begin(), c.end()); } so one could say
vector<int> v = ...
range_adapt(std::find, v);
for any collection type.
You know that this doesn't compile, because std::find is a function template right? (and you are also missing some parts in your function signature, but that’s just a minor detail) Most likely the standard library will finally get a std::find(range, value) but that doesn't help with the "problem" that there doesn't exist an algorithm "contains"/"includes" that searches only for a single element.
Robert Ramey
Mike