I have some code that currently uses raw pointers, and I want to change to smart pointers. This helps cleanup the code in various ways. Anyway, I have factory methods that retur
Here's a polymorphism example using unique pointer:
vector> creatures;
creatures.emplace_back(new Human);
creatures.emplace_back(new Fish);
unique_ptr> pLog(new vector());
for each (auto& creature in creatures)
{
auto state = creature->Move(*pLog);
}