Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
accum1.cpp
Go to the documentation of this file.
1 
7 #ifndef INC_TRAITS_ACCUM1_HPP
8 #define INC_TRAITS_ACCUM1_HPP
9 
10 #include "accum1.hpp"
11 #include <iostream>
12 
13 int main()
14 {
15  int num[] = {1, 2, 3, 4, 5};
16  std::cout << "the average value of the integer values is " << accum(&num[0], &num[5]) / 5 << '\n';
17  char name[] = "templates";
18  int length = sizeof(name) - 1;
19  std::cout << "the average value of the characters in \"" << name << "\" is "
20  << accum(&name[0], &name[length]) / length << '\n';
21  return 0;
22 }
23 
24 #endif // INC_TRAITS_ACCUM1_HPP
int main()
Definition: accum1.cpp:13
T accum(T const *beg, T const *end)
Definition: accum1.hpp:9