fork(5) download
  1. #include <iostream>
  2. #include <type_traits>
  3. using namespace std;
  4. class Bar
  5. {
  6. public:
  7. Bar(){cout<<__PRETTY_FUNCTION__<<endl;}
  8. ~Bar(){cout<<__PRETTY_FUNCTION__<<endl;}
  9. Bar(const Bar&){cout<<__PRETTY_FUNCTION__<<endl;}
  10. Bar(Bar&&){cout<<__PRETTY_FUNCTION__<<endl;}
  11. };
  12. class Foo
  13. {
  14. public:
  15. Foo(){}
  16. ~Foo() = default;
  17. // Foo(Foo&& ) = default;
  18.  
  19. Bar b;
  20. };
  21. int main() {
  22.  
  23. Foo f;
  24. Foo f2 = std::move(f);
  25.  
  26. cout<<std::is_move_constructible<Foo>::value<<endl;
  27. cout<<std::is_copy_constructible<Foo>::value<<endl;
  28. // your code goes here
  29. return 0;
  30. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Bar::Bar()
Bar::Bar(const Bar&)
1
1
Bar::~Bar()
Bar::~Bar()