26 typename C::value_type
sum(C
const& c)
28 typename C::value_type val =
typename C::value_type();
29 for (
auto it = c.cbegin(); it != c.cend(); ++it) {
41 std::cout <<
make_range(v) <<
" sum: " <<
sum(v) << std::endl;
46 std::cout <<
make_range(l) <<
" sum: " <<
sum(l) << std::endl;
Range (see also boost Range library)
C::value_type sum(C const &c)
Range< Iter > make_range(Iter it1, Iter it2)