fork(3) download
  1. #include <iostream>
  2. #include <memory>
  3. #include <vector>
  4. struct TEST
  5. {
  6. std::unique_ptr<int> m_l;
  7. TEST(
  8. std::unique_ptr<int>&& l)
  9. {
  10. m_l = std::move(l);
  11. };
  12.  
  13. };
  14. void Bar()
  15. {
  16. std::vector<TEST> vec;
  17. std::unique_ptr<int> a(new int);
  18. //Compiles fine without a Move Constructor
  19. TEST(std::move(a));
  20. //Requires a Move Contructor to compile
  21. vec.push_back(
  22. TEST(std::move(a)));
  23. }
  24. int main()
  25. {
  26. Bar();
  27. return 0;
  28. }
Success #stdin #stdout 0s 3424KB
stdin
Standard input is empty
stdout
Standard output is empty