如果使用标准的Loop,我可以删除一个向量。
如果每个循环都使用a,将执行什么步骤。
std::vector< std::shared_ptr<Sum_Function> > Functions; // Member of Container Class.
void Container::RemoveFunction(std::string stdstrFunctionName)
{
for (auto &func : this->Functions)
{
if (func->getFunctionName() == stdstrFunctionName)
{
// Remove from vector
// vec.erase(vec.begin() + i); i could have done in for loop
}
}
}