mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
Declare operator==
and operator!=
member functions const.
This commit is contained in:
parent
6ebfc4b2b0
commit
5088364b96
@ -288,8 +288,8 @@ public:
|
|||||||
// Past-the-end iterator:
|
// Past-the-end iterator:
|
||||||
iterator(size_t end) : curr(end) {}
|
iterator(size_t end) : curr(end) {}
|
||||||
public:
|
public:
|
||||||
bool operator==(const iterator &other) { return curr.index == other.curr.index; }
|
bool operator==(const iterator &other) const { return curr.index == other.curr.index; }
|
||||||
bool operator!=(const iterator &other) { return curr.index != other.curr.index; }
|
bool operator!=(const iterator &other) const { return curr.index != other.curr.index; }
|
||||||
iterator &operator++() {
|
iterator &operator++() {
|
||||||
if (!inst->simple_layout)
|
if (!inst->simple_layout)
|
||||||
curr.vh += 1 + (*types)[curr.index]->holder_size_in_ptrs;
|
curr.vh += 1 + (*types)[curr.index]->holder_size_in_ptrs;
|
||||||
|
Loading…
Reference in New Issue
Block a user