www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - [stlsoft-1.9.32] Bug in pod_vector::erase(iterator it)

reply =?UTF-8?B?Q2hyaXN0aWFuIFLDtnNzZWw=?= <christian.roessel gmx.de> writes:
Hello,

I found a bug in pod_vector::erase(iterator it). Instead of moving all
elements right of iterator it, only one element is moved. One possible fix
is to relpace the line (pod_vector.hpp line 1195)

        pod_move_n(&it[0], &it[1], 1);

with

        pod_move_n(&it[0], &it[1], end() - it - 1);

I'm using stlsoft-1.9.32.

Thanks for the library and regards,
Christian
Jun 11 2008
parent reply "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
Thanks for letting me know. I'll fix this and add to next 1.9.x release

Cheers

Matt

P.S. May I ask where you heard about STLSoft, and what you're using it for?
Thanks



"Christian Rössel" <christian.roessel gmx.de> wrote in message
news:g2o0ur$1o6g$1 digitalmars.com...
 Hello,

 I found a bug in pod_vector::erase(iterator it). Instead of moving all
 elements right of iterator it, only one element is moved. One possible fix
 is to relpace the line (pod_vector.hpp line 1195)

         pod_move_n(&it[0], &it[1], 1);

 with

         pod_move_n(&it[0], &it[1], end() - it - 1);

 I'm using stlsoft-1.9.32.

 Thanks for the library and regards,
 Christian

Jun 12 2008
parent =?UTF-8?B?Q2hyaXN0aWFuIFLDtnNzZWw=?= <christian.roessel gmx.de> writes:
Matthew Wilson schrieb:
 Thanks for letting me know. I'll fix this and add to next 1.9.x release=

=20
 Cheers
=20
 Matt
=20
 P.S. May I ask where you heard about STLSoft, and what you're using it =

I heard about STLSoft in one of your articles published in Dr. Dobbs or CUJ, I don't remember exactly which article. Currently I'm using only pod_vector from STLSoft. I use it as a replaceme= nt of std::vector if I need to clear the container frequently. In our traffi= c simulation, every vehicle collects every timestep it's neighbour vehicles= in several vectors, mostly using push_back. These vectors have to be cleared before the next timestep begins. Using pod_vector resulted in a 1= 5% overall speedup compared to std::vector, using VisualStudio 2005. Great! Regards, Christian
 "Christian R=EF=BF=BDssel" <christian.roessel gmx.de> wrote in message =

 Hello,

 I found a bug in pod_vector::erase(iterator it). Instead of moving all=


 elements right of iterator it, only one element is moved. One possible=


 is to relpace the line (pod_vector.hpp line 1195)

         pod_move_n(&it[0], &it[1], 1);

 with

         pod_move_n(&it[0], &it[1], end() - it - 1);

 I'm using stlsoft-1.9.32.

 Thanks for the library and regards,
 Christian

=20 =20

Jun 18 2008