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-constexpr.cxx
blob
ed624512d8eeabdd6c379512f76854e76f037da3
1
constexpr
int
square
(
int
x
)
2
{
3
return
x
*
x
;
4
}
5
6
constexpr
int
the_answer
()
7
{
8
return
42
;
9
}
10
11
int
main
()
12
{
13
int
test_arr
[
square
(
3
)];
14
bool
ret
= (
15
(
square
(
the_answer
()) ==
1764
) &&
16
(
sizeof
(
test_arr
)/
sizeof
(
test_arr
[
0
]) ==
9
)
17
);
18
return
ret
?
0
:
1
;
19
}