Here is another alternative that is simply a wrapper around boost and stl algorithms, and thus you get most of the performance benefits of those implementations.
It works like this:
std::vector xs;
auto count = from(xs)
.select([](int x){return x*x;})
.where([](int x){return x > 16;})
.count();
auto xs2 = from(xs)
.select([](int x){return x*x;})
.to>();
Note that some methods return a proxy for empty ranges, e.g.
std::vector xs;
auto max = from(xs)
.select([](int x){return x*x;})
.where([](int x){return x > 16;})
.max()
.value_or(default_max_value);
Feedback is welcome.