By Yasunori Osana on April 9, 2008 12:30 AM | Permalink | Comments (0) | TrackBacks (0) æ¡ä»¶ã«ãããããè¦ç´ ãé ã«æ¤ç´¢ãã¦åé¤ããã¨ãåé¤ããã¨ãã« iterator ãç¡å¹ã«ãªãã vector ãªããerase() ãåé¤å¾ã«æå¹ãªæ¬¡ã®è¦ç´ ã¸ã® iterator ãè¿ãã¦ãããã®ã§ã for (std::vector::iterator i = v.begin(); i != v.end(); ){ if ( condition ) i = v.erase(i); else i++; } map ã ã¨ãiterator ãè¿ãã¦ãããªãã®ã§ã for (std::map::iterator i = m.begin(); i != m.end(); ){ if (condition)
{{#tags}}- {{label}}
{{/tags}}