fork download
  1. class Base {
  2.  
  3. };
  4.  
  5. class Derived : public Base {
  6. public:
  7. Derived &operator=(const Base &) {
  8. return *this;
  9. }
  10. };
  11.  
  12. int main() {
  13. Base b;
  14. Derived d;
  15.  
  16. // To działa normalne.
  17. b = d;
  18.  
  19. // Tutaj potrzeba operatora.
  20. d = b;
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 2892KB
stdin
Standard input is empty
stdout
Standard output is empty