#30 Safe mode invalidates past-the-end iterators on clear()

unverified
closed-works-for-me
5
2006-06-27
2006-04-04
No

When in safe mode, list::clear() invalidates
all existing iterators to the container, including
past-the-end ones (i.e. those equalling list::end().)
But according to the standard (23.2.2.3/3), past-
the-end iterators are not invalidated by any
deletion operation.

It is possible that this problem shows as well
with other stable containers like the associative
types.

The error has been just discovered in connection
with a Boost library used in an STLport-powered
environment, as described at

http://lists.boost.org/Archives/boost/2006/04/102740.p
hp

Best regards,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

Discussion

  • Francois Dumont

    Francois Dumont - 2006-04-18

    Logged In: YES
    user_id=1096600

    Hello

    Thanks for the STLport-powered environment ;-)

    What STLport version are you using ? I took a look to
    STLport 5.0 branch and cvs head and in those versions, list
    end iterator should not be invalidaded on list clear. I
    remember that this bug has been reported a long time ago and
    applied also to associative containers.

    STLport head is geting quite mature so don't hesitate to
    have a try if you have some time.

     
  • Petr Ovtchenkov

    Petr Ovtchenkov - 2006-06-27

    Logged In: YES
    user_id=615813

    This work correctly as on 5.1 as on 5.0.x; test added.
    Thanks.

     
  • Petr Ovtchenkov

    Petr Ovtchenkov - 2006-06-27
    • assigned_to: nobody --> complement
    • status: open --> closed-works-for-me
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks