MainComputersProgrammingLanguages › Are Set Iterators Mutable or Immutable?

Are Set Iterators Mutable or Immutable?

Edit Page
Report
Scan day: 03 March 2014 UTC
29
Virus safety - good
Description: Portability issues in using the standard library. An article about portability issues in using the Standard Library by Klaus Kreft and Angelika Langer, published in the C/C++ Users Journal.
Are Set Iterators Mutable or Immutable? | Dr Dobb's Are Set Iterators Mutable or Immutable? 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.
Size: 633 chars

Contact Information

Phone&Fax:
Address:
Extended:

WEBSITE Info

Page title:Are Set Iterators Mutable or Immutable? | Dr Dobb's
Keywords:
Description: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.
IP-address:192.155.48.108

WHOIS Info

NS
Name Server: NS1.UBM-US.NET
Name Server: NS2.UBM-US.NET
Name Server: NS3.UBM-US.NET
WHOIS
Status: clientTransferProhibited
Date
Creation Date: 25-jun-1998
Expiration Date: 24-jun-2014