fork download
  1. #include <utility>
  2.  
  3. struct foo
  4. {
  5. foo() {}
  6. foo(foo&&) {}
  7.  
  8. // add this to get compliant behavior:
  9. /* foo(const foo&); */
  10. };
  11.  
  12. void test(foo) {}
  13.  
  14. int main()
  15. {
  16. foo f;
  17.  
  18. // should work:
  19. test(std::move(f));
  20.  
  21. // should not work:
  22. test(f); // but MSVC2010 and GCC 4.5 accept (fixed in GCC 4.6)
  23. }
  24.  
Success #stdin #stdout 0s 2824KB
stdin
Standard input is empty
stdout
Standard output is empty