Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void bar(){}
- constexpr int foo(int a)
- {
- if (a <=0 )
- bar();
- return 1;
- }
- int main()
- {
- int a1[foo(1)]; //no compile error
- }
- int a2[foo(-1)]; //will give a compile error, which is expected,
- //since non-constexpr function is not allowd in constexpr context
Add Comment
Please, Sign In to add comment