aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hashlib.h
diff options
context:
space:
mode:
authorAlberto Gonzalez <boqwxp@airmail.cc>2020-06-17 22:32:34 +0000
committerAlberto Gonzalez <boqwxp@airmail.cc>2020-06-19 17:44:29 +0000
commite5a2d17b5dffc69c9994d48c2c12288865b80156 (patch)
tree9cc11cdd8a3873069dd0d96991ee08c5ffdbccf7 /kernel/hashlib.h
parentd5d0cc88d272b85c3be3677993596dcfa82d579f (diff)
downloadyosys-e5a2d17b5dffc69c9994d48c2c12288865b80156.tar.gz
yosys-e5a2d17b5dffc69c9994d48c2c12288865b80156.tar.bz2
yosys-e5a2d17b5dffc69c9994d48c2c12288865b80156.zip
hashlib, rtlil: Add `operator+=()` to `dict<>::iterator` and `dict<>::const_iterator` and add `operator+()` and `operator+=()` to `ObjIterator`.
Diffstat (limited to 'kernel/hashlib.h')
-rw-r--r--kernel/hashlib.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/hashlib.h b/kernel/hashlib.h
index 5c87b55f5..52dfd1280 100644
--- a/kernel/hashlib.h
+++ b/kernel/hashlib.h
@@ -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; }