summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Speirs <bill.speirs@gmail.com>2014-10-14 17:10:08 -0400
committerClifford Wolf <clifford@clifford.at>2014-10-15 00:56:37 +0200
commit9cb230379901da89649676d4a2752bde59c09f59 (patch)
treee3246ec1a45128e7f4f30c23b57a298c6a280190
parent069521e2d5d5568739c7e8d7db31859bb88965a6 (diff)
Made iterators extend std::iterator and added == operator
-rw-r--r--kernel/rtlil.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 8df0bfe1..5629c865 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -920,23 +920,25 @@ struct RTLIL::SigBit
}
};
-struct RTLIL::SigSpecIterator
+struct RTLIL::SigSpecIterator : public std::iterator<std::input_iterator_tag, RTLIL::SigSpec>
{
RTLIL::SigSpec *sig_p;
int index;
inline RTLIL::SigBit &operator*() const;
inline bool operator!=(const RTLIL::SigSpecIterator &other) const { return index != other.index; }
+ inline bool operator==(const RTLIL::SigSpecIterator &other) const { return index == other.index; }
inline void operator++() { index++; }
};
-struct RTLIL::SigSpecConstIterator
+struct RTLIL::SigSpecConstIterator : public std::iterator<std::input_iterator_tag, RTLIL::SigSpec>
{
const RTLIL::SigSpec *sig_p;
int index;
inline const RTLIL::SigBit &operator*() const;
inline bool operator!=(const RTLIL::SigSpecConstIterator &other) const { return index != other.index; }
+ inline bool operator==(const RTLIL::SigSpecIterator &other) const { return index == other.index; }
inline void operator++() { index++; }
};