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


  UPCOMING
  PREVIOUS
  MATERIALS
 
GENERICS 
LAMBDAS 
IOSTREAMS 
ABOUT 
CONTACT 
Read-Only vs. Read-Write Set Iterators - STL Portability Problems

Read-Only vs. Read-Write Set Iterators - STL Portability Problems  
ABSTRACT
 
The set container in the STL must not allow modification of its contained elements because the element values determine the ordering of the underlying binary-tree-structure. Depending on the STL implementation this might be expressed in terms of set iterators being read-only iterators, which imposes severe restrictions on the usability of the container. In other STL implementations the set iterators are read-write iterators, which permits inadvertent corruption of the tree-structure. Both implementation techniques have up- and downsides. How do we effectively use these different set implementations and still write portable programs? 

One way of coping with the inherent portability trap is implementation of a simple adapter that hides the differences.  Most STL users shy away from implementing their own iterator types, but is easier than most developers believe.  In this tutorial we see how it can be done and why it is worth the effort. 

 
PREREQUISITES

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

 
Seminars
 
Effective STL Programming - Using and Extending the STL
4 day seminar (open enrollment and on-site)
 
Papers
 
New Features in ANSI  C++ How can we get the most out of them?
short white paper (providing first insights)
 
Slides
 
Software Development , San Jose, CA, April 2002

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