fork download
  1. #include <iostream>
  2. #include <memory>
  3.  
  4. int main()
  5. {
  6. std::unique_ptr<int> a(new int(159));
  7. auto var = a.get(); // Edited a => a.get() sorry
  8. a.release();
  9. std::cout<<*var<<std::endl; // prints "159"
  10. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
159