Cześć. Mam kłopot, bo muszę usunąć z vectora smartPointerów element podany w argumencie jako raw Pointer. Narazie to wygląda tak jak na dole ale nie działa bo oczywiście "no conversion from shared_ptr<T> to monster * ".
std::vector<std::shared_ptr<monster>> monsters; //siedzi w klasie
void wave::removeMonster(monster *m)
{
std::vector<monster>::iterator it = std::find(monsters.begin(), monsters.end(), m);
if (it != monsters.end())
{
monsters.erase(it);
}
}
Prosiłbym od razu wyjaśnić co i dlaczego