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-constexpr.cpp
Go to the documentation of this file.
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
}
square
constexpr int square(int x)
Definition:
cxx11-test-constexpr.cpp:1
main
int main(void)
Definition:
cxx11-test-__func__.cpp:1
the_answer
constexpr int the_answer()
Definition:
cxx11-test-constexpr.cpp:6
FairRoot
cmake
checks
cxx11-test-constexpr.cpp
Generated on Mon Mar 8 2021 12:14:05 for FairRoot by
1.8.5