FairRoot
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
cxx11-test-variadic_templates.cpp
Go to the documentation of this file.
1
int
Accumulate
()
2
{
3
return
0;
4
}
5
6
template
<
typename
T,
typename
... Ts>
7
int
Accumulate
(T v, Ts... vs)
8
{
9
return
v +
Accumulate
(vs...);
10
}
11
12
template
<
int
... Is>
13
int
CountElements
()
14
{
15
return
sizeof
...(Is);
16
}
17
18
int
main
()
19
{
20
int
acc =
Accumulate
(1, 2, 3, 4, -5);
21
int
count = CountElements<1,2,3,4,5>();
22
return
((acc == 5) && (count == 5)) ? 0 : 1;
23
}
CountElements
int CountElements()
Definition:
cxx11-test-variadic_templates.cpp:13
main
int main(void)
Definition:
cxx11-test-__func__.cpp:1
Accumulate
int Accumulate()
Definition:
cxx11-test-variadic_templates.cpp:1
FairRoot
cmake
checks
cxx11-test-variadic_templates.cpp
Generated on Mon Mar 8 2021 12:14:05 for FairRoot by
1.8.5