fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <memory>
  4.  
  5. using namespace std;
  6.  
  7. void f(std::unique_ptr<int>& ip)
  8. {
  9. std::cout << *ip << std::endl;
  10. }
  11. int main()
  12. {
  13. int i = 9333;
  14. std::unique_ptr<int> ip(new int(i));
  15. f(ip);
  16. }
  17.  
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
9333