Appendinganexistingshared_ptrtoavectorofshared_ptr我有一个shared_ptr的现有向量。我想搜索该向量,如果满足条件,请将相应的shared_ptr复制到新向量。...//vector>main_vec;//whichalreadyhassomedatavectorshared_ptrFoo>>output_vec{};for(autoiter=main_vec.begin();iter!=main_vec.end();++iter){ if((*iter)->bar()==true) output_vec.push_back(*iter)