fork(2) download
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. class Type
  7. {
  8. public:
  9. Type(int) { cout << "Type::Type(int)\n"; }
  10. operator int() { cout << "Type::operator int()\n"; return 0; }
  11. };
  12.  
  13.  
  14. int main(int argc, const char * argv[])
  15. {
  16. int s = 5;
  17. Type q = (Type)s;
  18. q = Type(s);
  19.  
  20. s = int(q);
  21. s = (int)q;
  22.  
  23. }
  24.  
Success #stdin #stdout 0s 4384KB
stdin
Standard input is empty
stdout
Type::Type(int)
Type::Type(int)
Type::operator int()
Type::operator int()