fork(5) download
  1. #include <type_traits>
  2. class B
  3. {
  4.  
  5. void fun() const
  6. {
  7. value = 0;
  8. }
  9.  
  10. static int value = 5;
  11. };
  12.  
  13. int main()
  14. {
  15. B b;
  16. b.fun();
  17.  
  18. }
Compilation error #stdin compilation error #stdout 0s 3340KB
stdin
Standard input is empty
compilation info
prog.cpp:10:21: error: ISO C++ forbids in-class initialization of non-const static member ‘B::value’
  static int value = 5;
                     ^
prog.cpp: In function ‘int main()’:
prog.cpp:5:7: error: ‘void B::fun() const’ is private
  void fun() const
       ^
prog.cpp:16:8: error: within this context
  b.fun();
        ^
stdout
Standard output is empty