From: William Speirs Date: Tue, 14 Oct 2014 21:10:08 +0000 (-0400) Subject: Made iterators extend std::iterator and added == operator X-Git-Tag: yosys-0.4~52^2~7 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9cb230379901da89649676d4a2752bde59c09f59;p=yosys.git Made iterators extend std::iterator and added == operator --- diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 8df0bfe19..5629c8652 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 { 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 { 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++; } };