fork download
  1. #include <iostream>
  2.  
  3. class Verbose {
  4. public:
  5. Verbose() { std::cout << "Verbose::Verbose()" << std::endl; }
  6. Verbose( int ) { std::cout << "Verbose::Verbose(int)" << std::endl; }
  7. Verbose &operator=( int ) { std::cout << "Verbose::operator=(int)" << std::endl; }
  8. };
  9.  
  10. class A {
  11. public:
  12. A() : v( 0 ) {}
  13. A(int) { v = 0; }
  14. private:
  15. Verbose v;
  16. };
  17.  
  18.  
  19. int main() {
  20. std::cout << "case 1 --------------------" << std::endl;
  21. A a1;
  22. std::cout << "case 1 --------------------" << std::endl;
  23. A a2( 0 );
  24. // your code goes here
  25. return 0;
  26. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
case 1 --------------------
Verbose::Verbose(int)
case 1 --------------------
Verbose::Verbose()
Verbose::operator=(int)