fork(1) download
  1. class A {
  2. void callAFunctionHere() {}
  3.  
  4. struct TimerService {
  5. TimerService() {
  6. callAFunctionHere();
  7. }
  8. };
  9. };
  10.  
  11. int main()
  12. {
  13. A a;
  14. A::TimerService ts;
  15. }
  16.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor 'A::TimerService::TimerService()':
prog.cpp:6:35: error: cannot call member function 'void A::callAFunctionHere()' without object
                 callAFunctionHere();
                                   ^
prog.cpp: In function 'int main()':
prog.cpp:4:16: error: 'struct A::TimerService' is private
         struct TimerService {
                ^
prog.cpp:14:12: error: within this context
         A::TimerService ts;
            ^
stdout
Standard output is empty