Gobelijn API documentation
- generated for commit a0cbea7
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Friends
Macros
Pages
accum7.cpp
Go to the documentation of this file.
1
7
#include "
accum6.hpp
"
8
#include <iostream>
9
10
class
MultPolicy
11
{
12
public
:
13
template
<
typename
T1,
typename
T2>
14
static
void
accumulate(T1& total, T2
const
& value)
15
{
16
total *= value;
17
}
18
};
19
20
int
main
()
21
{
22
// create array of 5 integer values
23
int
num[] = {1, 2, 3, 4, 5};
24
25
// print product of all values
26
std::cout <<
"the product of the integer values is "
<<
Accum<int, MultPolicy>::accum
(&num[0], &num[5]) <<
'\n'
;
27
return
0;
28
}
accum6.hpp
Accum::accum
static AT::type accum(T const *beg, T const *end)
Definition:
accum5.hpp:14
main
int main()
Definition:
accum7.cpp:20
main
cpp
template_traits
accum7.cpp
Generated on Fri Feb 1 2019 09:33:32 for Gobelijn API documentation by
1.8.6