3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 06:03:23 +00:00

hashlib, rtlil: Add operator+=() to dict<>::iterator and dict<>::const_iterator and add operator+() and operator+=() to ObjIterator.

This commit is contained in:
Alberto Gonzalez 2020-06-17 22:32:34 +00:00
parent d5d0cc88d2
commit e5a2d17b5d
No known key found for this signature in database
GPG key ID: 8395A8BA109708B2
2 changed files with 25 additions and 0 deletions

View file

@ -363,6 +363,7 @@ public:
public:
const_iterator() { }
const_iterator operator++() { index--; return *this; }
const_iterator operator+=(int amt) { index -= amt; if(index < 0) index = -1; return *this; }
bool operator<(const const_iterator &other) const { return index > other.index; }
bool operator==(const const_iterator &other) const { return index == other.index; }
bool operator!=(const const_iterator &other) const { return index != other.index; }
@ -380,6 +381,7 @@ public:
public:
iterator() { }
iterator operator++() { index--; return *this; }
iterator operator+=(int amt) { index -= amt; if(index < 0) index = -1; return *this; }
bool operator<(const iterator &other) const { return index > other.index; }
bool operator==(const iterator &other) const { return index == other.index; }
bool operator!=(const iterator &other) const { return index != other.index; }