Not. This object cannot be deleted with delete , which unique_ptr will do. You need
auto iptr = make_unique<int>();
Here we define make_unique as a utility function identical to make_shared, which was supposed to be standard, but unfortunately was missed. Here's a summary:
template<typename T, typename... Args> std::unique_ptr<T> make_unique(Args&&... args) { return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); }
Puppy source share