diff options
author | arseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640> | 2012-03-14 05:34:00 +0000 |
---|---|---|
committer | arseny.kapoulkine@gmail.com <arseny.kapoulkine@gmail.com@99668b35-9821-0410-8761-19e4c4f06640> | 2012-03-14 05:34:00 +0000 |
commit | e4ae72937054324ccee6d67579d4fb7040d916dc (patch) | |
tree | 829afc827c5eb3b2568e52c5b1c532328046f82a /src/pugixml.cpp | |
parent | 23f891a92bddc38dce8c99674edd31281eaf7ca8 (diff) |
Dereferemce operators in both iterators are now const; this fixes iterator compatibility with parts of Boost Iterator (i.e. filter_iterator). It is now possible to damage the state of const_iterator by directly mutating internal handle - working around that introduces additional performance penalties and is generally extremely unlikely to be useful - constant iterator objects are rarely used.
git-svn-id: http://pugixml.googlecode.com/svn/trunk@858 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r-- | src/pugixml.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index de8af95..572576b 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -4652,13 +4652,13 @@ namespace pugi return _wrap._root != rhs._wrap._root || _parent._root != rhs._parent._root; } - PUGI__FN xml_node& xml_node_iterator::operator*() + PUGI__FN xml_node& xml_node_iterator::operator*() const { assert(_wrap._root); return _wrap; } - PUGI__FN xml_node* xml_node_iterator::operator->() + PUGI__FN xml_node* xml_node_iterator::operator->() const { assert(_wrap._root); return &_wrap; @@ -4713,13 +4713,13 @@ namespace pugi return _wrap._attr != rhs._wrap._attr || _parent._root != rhs._parent._root; } - PUGI__FN xml_attribute& xml_attribute_iterator::operator*() + PUGI__FN xml_attribute& xml_attribute_iterator::operator*() const { assert(_wrap._attr); return _wrap; } - PUGI__FN xml_attribute* xml_attribute_iterator::operator->() + PUGI__FN xml_attribute* xml_attribute_iterator::operator->() const { assert(_wrap._attr); return &_wrap; |