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