fork download
  1. #include <memory>
  2. #include <future>
  3. #include <thread>
  4.  
  5. using namespace std;
  6.  
  7. unique_ptr<int> uq(new int);
  8. void foo(unique_ptr<int> q)
  9. {}
  10.  
  11. int main()
  12. {
  13. foo(move(uq)); // OK.
  14. async(foo, move(uq)); // Error: error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>'
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 3036KB
stdin
Standard input is empty
stdout
Standard output is empty