fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. struct base
  6. {
  7. string &s;
  8. base(string &s1) : s(s1) {}
  9. //base(base&&) = default;
  10. };
  11.  
  12. struct base2
  13. {
  14. string &s;
  15. base2(string &s1) : s(s1) {}
  16. //base2(base2&&) = default;
  17. };
  18.  
  19. struct derived
  20. :base
  21. ,base2
  22. {
  23. derived(string &arg)
  24. :base(arg)
  25. ,base2(arg)
  26. {}
  27.  
  28. //derived(derived&&) = default;
  29. //derived(const derived&) = delete;
  30. };
  31.  
  32. int main() {
  33. string s;
  34. derived d1(s);
  35. derived d2(std::move(d1));
  36. return 0;
  37. }
  38.  
  39.  
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty