Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
October 01, 2000
Are Set Iterators Mutable or Immutable?

(Page 1 of 3)
Klaus Kreft
The C++ Standard mandates that containers such as std::set provide both mutable and immutable iterators. Unfortunately, mutable iterators turn out to be dangerous when used with sets. If you use one to modify an element of a set, you risk corrupting the underlying data structure. Langer and Kreft explain why this is so, and they discuss some of the less-than-desirable solutions - including non-portable implementations of the standard library. The authors then propose a more sensible, and portable, solution using iterator adapters.
October 2000 C++ Experts Forum/Effective Standard C++ Library/Figure 1

Figure 1: The remove algorithms do not remove anything

1 | 2 | 3 Next Page
RELATED ARTICLES
No Related Articles
TOP 5 ARTICLES
No Top Articles.
DR. DOBB'S CAREER CENTER
Ready to take that job and shove it? open | close
Search jobs on Dr. Dobb's TechCareers
Function:

Keyword(s):

State:  
  • Post Your Resume
  • Employers Area
  • News & Features
  • Blogs & Forums
  • Career Resources

    Browse By:
    Location | Employer | City
  • Most Recent Posts:



    MICROSITES
    FEATURED TOPIC

    ADDITIONAL TOPICS

    INFO-LINK



     
    ♦ sponsored




    Related Sites: DotNetJunkies, SD Expo, SqlJunkies