Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
constexpr expirements
//g++ 5.4.0 #include <iostream> constexpr int arr0[5] = { 1, 2, 3, 4, 5 }; constexpr const int arr1[5] = { 1, 2, 3, 4, 5 }; int arr2[5] = { 1, 2, 3, 4, 5 }; const int arr3[5] = { 1, 2, 3, 4, 5 }; constexpr int func0() { return arr0[2]; } constexpr int func1() { return arr1[2]; } //constexpr int func2() { return arr2[2]; } // Ошибка //constexpr int func3() { return arr3[2]; } // Ошибка int main() { constexpr int i0 = func0(); constexpr int i1 = func1(); //constexpr int i2 = func2(); //constexpr int i3 = func3(); }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
pattern
Finding the first digit of a number
poker.hpp
cs
Empty C++ Script
Elevator
same
area of a circle using pointer
ForwardLiceSplice
3SUM problem
stackse - search stackoverflow differently
Please log in to post a comment.