Angelika Langer - Training & Consulting
HOME | COURSES | TALKS | ARTICLES | GENERICS | LAMBDAS | IOSTREAMS | ABOUT | NEWSLETTER | CONTACT | Twitter | Lanyrd | Linkedin
HOME 


  UPCOMING
  PREVIOUS
  MATERIALS
 
GENERICS 
LAMBDAS 
IOSTREAMS 
ABOUT 
NEWSLETTER 
CONTACT 
Invalidation of STL Iterators - Effective STL Programming

Invalidation of STL Iterators - Effective STL Programming  
ABSTRACT
 
Iterators are pointer-like objects that refer to elements maintained in a container. In the STL, iterators are key abstractions on equal footing with containers and algorithms.  In fact, iterators are the glue between them and need to be thoroughly understood by every STL user.  In this tutorial we look into one of the surprises related to use of iterators: invalidation.

Depending on the type of the container, any operations performed on the container might invalidate any iterators pointing to elements in the container. These invalidation are in part expected, but sometimes they come as a surprise.  Ever too often, programmers overlook this side-effect of iterator invalidation and as a result, have to cope with errors that are hard to track down - pretty much like traditional pointer problems. 

 
PREREQUISITES

 
Level: intermediate
Duration: 90 minutes
Prerequisites: basic knowledge of C++ and the STL
Presented at: Software Development , San Jose, CA, April 2002
DevConnections , Orlando, FL, October 2002

 

If you are interested to hear more about this and related topics you might want to check out the following seminar or skim through some further reading:
 
Seminars
 
Effective STL Programming - 
Using and Extending the STL
4 day seminar (open enrollment and on-site)
 
Paper
 
New Features in ANSI  C++ 
How can we get the most out of them?
short white paper (providing first insights)
 
Slides
 
DevConnections , Orlando, FL, October 2002

 
  © Copyright 1995-2005 by Angelika Langer.  All Rights Reserved.    URL: < http://www.AngelikaLanger.com/Conferences/Abstracts/InvalidIterators.htm  last update: 6 Nov 2005