0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-26 21:04:25 +08:00

Merge pull request #418 from neheb/ranges

remove const from xml_node_iterator ++/--

Fixes #417.
This commit is contained in:
Arseny Kapoulkine 2021-04-26 14:32:51 -07:00 committed by GitHub
commit 5d58e94b6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -6735,7 +6735,7 @@ namespace pugi
return const_cast<xml_node*>(&_wrap); // BCC5 workaround return const_cast<xml_node*>(&_wrap); // BCC5 workaround
} }
PUGI__FN const xml_node_iterator& xml_node_iterator::operator++() PUGI__FN xml_node_iterator& xml_node_iterator::operator++()
{ {
assert(_wrap._root); assert(_wrap._root);
_wrap._root = _wrap._root->next_sibling; _wrap._root = _wrap._root->next_sibling;
@ -6749,7 +6749,7 @@ namespace pugi
return temp; return temp;
} }
PUGI__FN const xml_node_iterator& xml_node_iterator::operator--() PUGI__FN xml_node_iterator& xml_node_iterator::operator--()
{ {
_wrap = _wrap._root ? _wrap.previous_sibling() : _parent.last_child(); _wrap = _wrap._root ? _wrap.previous_sibling() : _parent.last_child();
return *this; return *this;
@ -6796,7 +6796,7 @@ namespace pugi
return const_cast<xml_attribute*>(&_wrap); // BCC5 workaround return const_cast<xml_attribute*>(&_wrap); // BCC5 workaround
} }
PUGI__FN const xml_attribute_iterator& xml_attribute_iterator::operator++() PUGI__FN xml_attribute_iterator& xml_attribute_iterator::operator++()
{ {
assert(_wrap._attr); assert(_wrap._attr);
_wrap._attr = _wrap._attr->next_attribute; _wrap._attr = _wrap._attr->next_attribute;
@ -6810,7 +6810,7 @@ namespace pugi
return temp; return temp;
} }
PUGI__FN const xml_attribute_iterator& xml_attribute_iterator::operator--() PUGI__FN xml_attribute_iterator& xml_attribute_iterator::operator--()
{ {
_wrap = _wrap._attr ? _wrap.previous_attribute() : _parent.last_attribute(); _wrap = _wrap._attr ? _wrap.previous_attribute() : _parent.last_attribute();
return *this; return *this;
@ -6857,7 +6857,7 @@ namespace pugi
return const_cast<xml_node*>(&_wrap); // BCC5 workaround return const_cast<xml_node*>(&_wrap); // BCC5 workaround
} }
PUGI__FN const xml_named_node_iterator& xml_named_node_iterator::operator++() PUGI__FN xml_named_node_iterator& xml_named_node_iterator::operator++()
{ {
assert(_wrap._root); assert(_wrap._root);
_wrap = _wrap.next_sibling(_name); _wrap = _wrap.next_sibling(_name);
@ -6871,7 +6871,7 @@ namespace pugi
return temp; return temp;
} }
PUGI__FN const xml_named_node_iterator& xml_named_node_iterator::operator--() PUGI__FN xml_named_node_iterator& xml_named_node_iterator::operator--()
{ {
if (_wrap._root) if (_wrap._root)
_wrap = _wrap.previous_sibling(_name); _wrap = _wrap.previous_sibling(_name);

View File

@ -851,10 +851,10 @@ namespace pugi
xml_node& operator*() const; xml_node& operator*() const;
xml_node* operator->() const; xml_node* operator->() const;
const xml_node_iterator& operator++(); xml_node_iterator& operator++();
xml_node_iterator operator++(int); xml_node_iterator operator++(int);
const xml_node_iterator& operator--(); xml_node_iterator& operator--();
xml_node_iterator operator--(int); xml_node_iterator operator--(int);
}; };
@ -893,10 +893,10 @@ namespace pugi
xml_attribute& operator*() const; xml_attribute& operator*() const;
xml_attribute* operator->() const; xml_attribute* operator->() const;
const xml_attribute_iterator& operator++(); xml_attribute_iterator& operator++();
xml_attribute_iterator operator++(int); xml_attribute_iterator operator++(int);
const xml_attribute_iterator& operator--(); xml_attribute_iterator& operator--();
xml_attribute_iterator operator--(int); xml_attribute_iterator operator--(int);
}; };
@ -929,10 +929,10 @@ namespace pugi
xml_node& operator*() const; xml_node& operator*() const;
xml_node* operator->() const; xml_node* operator->() const;
const xml_named_node_iterator& operator++(); xml_named_node_iterator& operator++();
xml_named_node_iterator operator++(int); xml_named_node_iterator operator++(int);
const xml_named_node_iterator& operator--(); xml_named_node_iterator& operator--();
xml_named_node_iterator operator--(int); xml_named_node_iterator operator--(int);
private: private: