Re: [Flightgear-devel] STL and vectors (final?)

2002-10-08 Thread ace project
--- 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

Re: [Flightgear-devel] STL and vectors (final?)

2002-10-08 Thread Bernie Bright
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]);

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread ace project
--- 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]

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread Frederic Bouvier
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

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread ace project
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

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread David Megginson
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,

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread David Megginson
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.

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread Bernie Bright
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

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread Bernie Bright
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

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread Andy Ross
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

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread Andy Ross
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.

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread David Megginson
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

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread Erik Hofman
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

Re: [Flightgear-devel] STL and vectors

2002-10-07 Thread Bernie Bright
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

Re: [Flightgear-devel] STL and vectors

2002-10-04 Thread Erik Hofman
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

[Flightgear-devel] STL and vectors

2002-10-03 Thread Erik Hofman
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]

re: [Flightgear-devel] STL and vectors

2002-10-03 Thread David Megginson
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

Re: [Flightgear-devel] STL and vectors

2002-10-03 Thread Erik Hofman
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

Re: [Flightgear-devel] STL and vectors

2002-10-03 Thread Jon S Berndt
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

Re: [Flightgear-devel] STL and vectors

2002-10-03 Thread Erik Hofman
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

Re: [Flightgear-devel] STL and vectors

2002-10-03 Thread Norman Vine
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