Unique PTR
Unique PTR
#include <utility>
friend bool operator!=(const UP& lhs, const UP& rhs) {return !(lhs == rhs);}
};
int main() {
// Create a UP to a Derived object
UP<Base> ok(new Base);
UP<Derived> basePtr = make_unique<Derived>();
ok = std::move(basePtr);
// Use the managed object
ok->print();