Find element yielding the largest value w.r.t. custom function
Setting aside the std::accumulate discussion, I have one recommendation. The signature

template&lt;typename Iterator, typename UnaryFun&gt;
auto maxElementBy(Iterator first, Iterator last, UnaryFun criterion)
    -&gt; Iterator


seems to be more flexible. It allows partial ranges, and seems more in line with the std design approach.