[Webkit-unassigned] [Bug 41237] New: HashSet iterators are quasi-mutable.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jun 25 17:11:50 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=41237
Summary: HashSet iterators are quasi-mutable.
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P2
Component: Web Template Framework
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: nlawrence at apple.com
CC: ggaren at apple.com, slewis at apple.com,
nlawrence at apple.com
Nathan Lawrence <nlawrence at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #59813| |review?
Flag| |
Created an attachment (id=59813)
--> (https://bugs.webkit.org/attachment.cgi?id=59813)
Patch
Changing the value through dereferencing an iterator will not change the behavior of methods like contains or find, but will change the behavior of iterating. For example, under the current implementation the following code would print "2, 4, 3" but myHashSet.contains(4) would return false.
HashSet<int> myHashSet;
myHashSet.add(1);
myHashSet.add(2);
myHashSet.add(3);
int& one = myHashSet.find(1);
one = 2;
for (HashSet<int>::iterator i = myHashSet.begin(); i != myHashSet.end(); ++i)
fprintf(stderr, "%u, ", i);
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list