--- Bernie Bright [EMAIL PROTECTED] wrote:
On Mon, 7 Oct 2002 08:09:32 -0400
Norman Vine [EMAIL PROTECTED] wrote:
ace project writes:
vector_of_elements.erase(vector_of_elements[index]);
I think your are making the too rapid
assumption that
an iterator is a
On Tue, 8 Oct 2002 00:16:24 -0700
ace project [EMAIL PROTECTED] wrote:
--- Bernie Bright [EMAIL PROTECTED] wrote:
On Mon, 7 Oct 2002 08:09:32 -0400
Norman Vine [EMAIL PROTECTED] wrote:
ace project writes:
vector_of_elements.erase(vector_of_elements[index]);
--- Erik Hofman [EMAIL PROTECTED] wrote:
Norman Vine wrote:
how about
vector v;
v.erase(v.begin()+index);
Yep. that was it.
Thanks Norman
Erik
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
From: ace project [EMAIL PROTECTED]
--- Erik Hofman [EMAIL PROTECTED] wrote:
Norman Vine wrote:
how about
vector v;
v.erase(v.begin()+index);
Yep. that was it.
Thanks Norman
Erik
___
Flightgear-devel
How about this one, is it wrong ?:
vector_of_elements.erase(element[index]);
Or should it be :
vector_of_elements.erase(vector_of_elements[index]);
I think your are making the too rapid assumption
that
an iterator is a pointer to an element.
Cheers,
-Fred
Thats the one I ment
Frederic Bouvier writes:
Or should it be :
vector_of_elements.erase(vector_of_elements[index]);
I think your are making the too rapid assumption that
an iterator is a pointer to an element.
Don't iterators override the '+' operator if they're not just
pointers?
All the best,
ace project writes:
How about this one, is it wrong ?:
vector_of_elements.erase(element[index]);
Or should it be :
vector_of_elements.erase(vector_of_elements[index]);
I think your are making the too rapid assumption
that
an iterator is a pointer to an element.
On Mon, 7 Oct 2002 07:36:53 -0400
David Megginson [EMAIL PROTECTED] wrote:
Frederic Bouvier writes:
Or should it be :
vector_of_elements.erase(vector_of_elements[index]);
I think your are making the too rapid assumption that
an iterator is a pointer to an element.
Don't
On Mon, 7 Oct 2002 08:09:32 -0400
Norman Vine [EMAIL PROTECTED] wrote:
ace project writes:
vector_of_elements.erase(vector_of_elements[index]);
I think your are making the too rapid assumption that
an iterator is a pointer to an element.
Thats the one I ment Fred (my
David Megginson wrote:
Frederic Bouvier wrote:
I think your are making the too rapid assumption that
an iterator is a pointer to an element.
Don't iterators override the '+' operator if they're not just
pointers?
Indeed. That's the whole genius (madness, whatever) behind the idea.
Many
Bernie Bright wrote:
Only random access iterators support the '+' operator. Fortunately
std::vector and std::deque provide just such iterators.
I thought there was a variant that supported incrementation but not
decrementation. You don't need the full-on random access variant in
this case.
Andy Ross writes:
Of course, the cost of that elegance is a library that almost no one
understands.
[David raises his hand in acknowledgement.]
That's the problem, really. Having any standard container library is
a godsend for coding and debugging, and STL is serving FlightGear well
-- I
David Megginson wrote:
-- I think that plib's avoiding STL is just silly --
I can understand it: it saves them from all the STL related cruft that
FlightGear has to carry along. I think STL wasn't matured enough when
FlightGear started to use it, but it's staring to come along lately
On Mon, 07 Oct 2002 09:53:09 -0700
Andy Ross [EMAIL PROTECTED] wrote:
Bernie Bright wrote:
Only random access iterators support the '+' operator. Fortunately
std::vector and std::deque provide just such iterators.
I thought there was a variant that supported incrementation but not
Norman Vine wrote:
how about
vector v;
v.erase(v.begin()+index);
Yep. that was it.
Thanks Norman
Erik
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Hi,
Can someone explain me how to erase a member from an STL vector?
I've tried several things, but it looks like it isn't removed anyhow.
Erik
___
Flightgear-devel mailing list
[EMAIL PROTECTED]
Erik Hofman writes:
Can someone explain me how to erase a member from an STL vector?
I've tried several things, but it looks like it isn't removed anyhow.
You need to use erase(), passing in an iterator (yes, I know, I hate
STL iterators too -- another idea that was just a little too
David Megginson wrote:
Erik Hofman writes:
Can someone explain me how to erase a member from an STL vector?
I've tried several things, but it looks like it isn't removed anyhow.
You need to use erase(), passing in an iterator (yes, I know, I hate
STL iterators too -- another idea
On Thu, 03 Oct 2002 17:06:28 +0200
Erik Hofman [EMAIL PROTECTED] wrote:
Is there an easy way to get an itterator from an indexed
value (e.g. value[1]), or do i need do to everything with
iterators then?
Erik
What, exactly, are you trying to do?
If it helps, there's some example code in
Jon S Berndt wrote:
On Thu, 03 Oct 2002 17:06:28 +0200
Erik Hofman [EMAIL PROTECTED] wrote:
Is there an easy way to get an itterator from an indexed value (e.g.
value[1]), or do i need do to everything with iterators then?
Erik
What, exactly, are you trying to do?
I'm creating a
Erik Hofman writes:
David Megginson wrote:
Erik Hofman writes:
Can someone explain me how to erase a member from an STL vector?
I've tried several things, but it looks like it isn't removed anyhow.
You need to use erase(), passing in an iterator (yes, I know, I hate
STL
21 matches
Mail list logo