fork download
  1. #include <iostream>
  2.  
  3. class XX
  4. {
  5. public:
  6. XX() {std::cout<<"C XX\n";}
  7. private:
  8. ~XX() {std::cout<<"~ XX\n";}
  9. };
  10.  
  11. int main() {
  12. XX *xx = new class XX(); // OK
  13. XX xx2(); // OK
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
C XX