fork(75) download
  1. #include <vector>
  2.  
  3. struct notCopyable
  4. {
  5. notCopyable() = default;
  6. notCopyable(const notCopyable&) = delete;
  7. notCopyable& operator = (const notCopyable&) = delete;
  8.  
  9. notCopyable(notCopyable&&) = default;
  10. notCopyable& operator = (notCopyable&&) = default;
  11. };
  12.  
  13. int main()
  14. {
  15. std::vector<notCopyable> v;
  16. notCopyable nc;
  17.  
  18. v.push_back(notCopyable{});
  19. v.emplace_back();
  20. v.push_back(std::move(nc));
  21. }
Success #stdin #stdout 0s 3424KB
stdin
Standard input is empty
stdout
Standard output is empty