ChaiScript/cmake/c++11-test-constexpr-N2235.cpp
Jason Turner 953c4e4847 Merge branch 'master' into 2011-09-09-CxScript
Conflicts:
	CMakeLists.txt
2012-06-13 21:54:48 -06:00

20 lines
271 B
C++

constexpr int square(int x)
{
return x*x;
}
constexpr int the_answer()
{
return 42;
}
int main()
{
int test_arr[square(3)];
bool ret = (
(square(the_answer()) == 1764) &&
(sizeof(test_arr)/sizeof(test_arr[0]) == 9)
);
return ret ? 0 : 1;
}