Use std::accumulate instead of the boost's counterpart
Use C++11's native for construct instead of BOOST_FOREACH