diff options
author | whitequark <whitequark@whitequark.org> | 2020-06-21 02:05:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-21 02:05:12 +0000 |
commit | 992d694d39db859bd7b554126881be69f3cfcd2e (patch) | |
tree | 886a5fb040960e58dace59ecf6ca1d3db601e093 /kernel/hashlib.h | |
parent | 338ecbe02f8bb3cc4d69de1445c7f398a814b4e4 (diff) | |
parent | d71a9badda20d48bcd4031f030d2d0901f837261 (diff) | |
download | yosys-992d694d39db859bd7b554126881be69f3cfcd2e.tar.gz yosys-992d694d39db859bd7b554126881be69f3cfcd2e.tar.bz2 yosys-992d694d39db859bd7b554126881be69f3cfcd2e.zip |
Merge pull request #2177 from boqwxp/dict-iterator-jump
hashlib, rtlil: Add `operator+()` and `operator+=()` to `dict` iterators
Diffstat (limited to 'kernel/hashlib.h')
-rw-r--r-- | kernel/hashlib.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/hashlib.h b/kernel/hashlib.h index 5c87b55f5..a523afadd 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; 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; 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; } |