Not sure what compiler this code was tested on, but we need the following headers to allow our example to compile.
#include <numeric> // std::accumulate #include <functional> // std::mem_fn
Before: gcc | clang After: gcc | clang