void SmartPointerDemo4() { // Create the object and pass it to a smart pointer std::unique_ptr pLarge(new LargeObject()); //Call a method on the object pLarge->DoSomething(); // Pass raw pointer to a legacy API LegacyLargeObjectFunction(pLarge.get()); }