Re: removing a elt from a std::vector in C++
- From: "Jonathon Jongsma" <jonathon jongsma gmail com>
- To: "Grizzly(Francis Smit)" <grizzly smit id au>
- Cc: gtkmm-list gnome org
- Subject: Re: removing a elt from a std::vector in C++
- Date: Wed, 18 Jul 2007 10:47:26 -0500
On 7/18/07, Grizzly(Francis Smit) <grizzly smit id au> wrote:
Hi list,
basically I want to remove an elt from a std::vector
but I dont know of any method to do so does any one
know how.
This is really a C++ question and not a gtkmm question, so this isn't
really the right list for it. But anyway, you can remove an element
from a vector with vector<>::erase(iterator) [1]. Note that it could
be expensive to do this for a vector, it's must less expensive to
remove an element from a std::list, so if you're doing it a lot, you
might consider whether you're using the correct container type.
[1] http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/classstd_1_1vector.html#24fda834262bd1148da26ef6f5f9ab1e
--
jonner
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]