fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. class C
  6. {
  7. public:
  8. C() { cout << "Default Constructor Called" << endl; }
  9. C( const std::string& ) { cout << "String Constructor Called" << endl; }
  10. };
  11.  
  12. void f( const C& ) { }
  13.  
  14. int main() {
  15. std::string s;
  16. f( s );
  17. return 0;
  18. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
String Constructor Called