fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Test
  5. {
  6. Test(const Test&) = delete;
  7. Test(int)
  8. {
  9. cout << __PRETTY_FUNCTION__ << endl;
  10. }
  11. Test& operator=(int)
  12. {
  13. cout << __PRETTY_FUNCTION__ << endl;
  14. return *this;
  15. }
  16. };
  17. int main()
  18. {
  19. Test t(10);
  20. //Test t1 = 10; // Error copy -constructor used in this!
  21. t = 20;
  22. return 0;
  23. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
Test::Test(int)
Test& Test::operator=(int)