Using std::unique_ptr for down cast
Flaviu_
666
Reputation points
What is the correct usage of std::unique_ptr for converting to base class a derived class ?
std::unique_ptr<Base*> SomeMethod()
{
return std::unique_ptr<Derived*>(new Derived());
return std::make_unique<Base*>(new Derived());
}
?