10 template <
typename T1,
typename T2>
14 static void accumulate(T1& total,
const T2& value) { total *= value; }
19 int num[] = {1, 2, 3, 4, 5};
20 std::cout <<
"the average value of the integer values is " <<
Accum<int>::accum(&num[0], &num[5]) / 5 <<
'\n';
23 char name[] =
"templates";
24 int length =
sizeof(name) - 1;
25 std::cout <<
"the average value of the characters in \"" << name <<
"\" is "
static AT::type accum(T const *beg, T const *end)