repo.or.cz
/
trojita.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge "Fix assert on saving settings"
[trojita.git]
/
cmake
/
FindCXXFeatures
/
cxx11-test-variadic_templates.cxx
blob
4518e886fd188a51fa8e8c2eef3216566f8481f3
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
}