fork(1) download
  1.  
  2. //Case 1
  3. constexpr int doSomethingMore(int x)
  4. {
  5. return x + 1;
  6. }
  7.  
  8. //Case 2
  9. constexpr int doSomething(int x)
  10. {
  11. return ++x;
  12. }
  13.  
  14.  
  15. int main()
  16. {
  17.  
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘constexpr int doSomething(int)’:
prog.cpp:12:1: error: expression ‘++ x’ is not a constant-expression
stdout
Standard output is empty