#include "array_wrap.hpp" #include #include template typename boost::range_value::type sum (in_t const& in) { typename boost::range_const_iterator::type i = boost::begin (in); typename boost::range_const_iterator::type e = boost::end (in); typename boost::range_value::type o = 0; for (; i != e; ++i) o += *i; return o; } int main () { double x[10]; for (int i = 0; i < 10; ++i) x[i] = i; double y = sum (array_wrap (x, 10)); std::cout << y << '\n'; }