fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct mystring {
  5. mystring(const char* str) {
  6. cout << "Constructed '" << str << "'" << endl;
  7. }
  8. bool operator==(const mystring& other) const {
  9. cout << "Compared" << endl;
  10. return false;
  11. }
  12. };
  13.  
  14. int main() {
  15. mystring a("hello");
  16. a == "world";
  17. return 0;
  18. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
Constructed 'hello'
Constructed 'world'
Compared