3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-29 07:27:58 +00:00

rtlil, hashlib: Remove deprecated std::iterator usage

`std::iterator` has been deprecated in C++17. Yosys is being compiled
against the C++11 standard but plugins can opt to compile against a
newer one. To silence some deprecation warnings when those plugins are
being compiled, replace the `std::iterator` inheritance with the
equivalent type declarations.
This commit is contained in:
Martin Povišer 2023-12-09 18:43:38 +01:00
parent e6021b2b48
commit 189064b8da
2 changed files with 44 additions and 7 deletions

View file

@ -803,8 +803,14 @@ struct RTLIL::SigBit
unsigned int hash() const;
};
struct RTLIL::SigSpecIterator : public std::iterator<std::input_iterator_tag, RTLIL::SigSpec>
struct RTLIL::SigSpecIterator
{
typedef std::input_iterator_tag iterator_category;
typedef RTLIL::SigSpec value_type;
typedef ptrdiff_t difference_type;
typedef RTLIL::SigSpec* pointer;
typedef RTLIL::SigSpec& reference;
RTLIL::SigSpec *sig_p;
int index;
@ -814,8 +820,14 @@ struct RTLIL::SigSpecIterator : public std::iterator<std::input_iterator_tag, RT
inline void operator++() { index++; }
};
struct RTLIL::SigSpecConstIterator : public std::iterator<std::input_iterator_tag, RTLIL::SigSpec>
struct RTLIL::SigSpecConstIterator
{
typedef std::input_iterator_tag iterator_category;
typedef RTLIL::SigSpec value_type;
typedef ptrdiff_t difference_type;
typedef RTLIL::SigSpec* pointer;
typedef RTLIL::SigSpec& reference;
const RTLIL::SigSpec *sig_p;
int index;