Thread overview
[stlsoft-1.9.32] Bug in pod_vector::erase(iterator it)
Jun 11, 2008
Christian Rössel
Jun 12, 2008
Matthew Wilson
Jun 18, 2008
Christian Rössel
June 11, 2008
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
June 12, 2008
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



June 18, 2008
Matthew Wilson schrieb:
> 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

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 replacement of std::vector if I need to clear the container frequently. In our traffic 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 15% overall speedup compared to std::vector, using VisualStudio 2005. Great!

Regards,
Christian


> "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
> 
> 
>