Fri, 23 Aug 2013 01:20:09 +0300
bit of a clarification
473
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | constexpr int square(int x) |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | { |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
3 | return x*x; |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | } |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | constexpr int the_answer() |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | { |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | return 42; |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | } |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | int main() |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | { |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | int test_arr[square(3)]; |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | bool ret = ( |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | (square(the_answer()) == 1764) && |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | (sizeof(test_arr)/sizeof(test_arr[0]) == 9) |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | ); |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | return ret ? 0 : 1; |
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | } |