#include #include template int f1(container &c) { return std::accumulate(std::begin(c), std::end(c), 0); } template int f2(container &c) { return std::accumulate(std::begin(c), std::end(c), 0) + std::accumulate(std::begin(c), std::end(c), 0); } int main() { std::vector v(1 << 25); return f1(v) + f2(v); }