#include #include #include #include #include #include #include using namespace std; struct NUM { int num; NUM (int _num) :num(_num){} ~NUM(){ printf ("delete num=%d\n",num); } }; template void test() { vector tb{1,2,3,4,5,6,7,8,9,10}; for (auto &i:tb) cout << i.num << endl; auto end = remove_if(tb.begin(),tb.end(),[](auto &a){return a.num & 1;}); printf ("Avant erase\n"); tb.erase (end,tb.end()); printf ("-----apres\n"); printf ("tb.size=%lu\n",tb.size()); for (auto &i:tb) cout << i.num << endl; } int main (int argc, char *argv[]) { glocal int ret = -1; glocal.ret = (argc,argv); setproginfo ("","0.0","..."); int ret = -1; test(); return ret; return glocal.ret; }