|
19 | 19 | #include <algorithm> |
20 | 20 | #include <cassert> |
21 | 21 | #include <cstring> |
22 | | -#include <iterator> |
23 | 22 | #include <map> |
24 | 23 |
|
25 | 24 | #include <Runtime.h> |
@@ -59,12 +58,21 @@ extern std::map<uintptr_t, SymExpr *> g_shadow_pages; |
59 | 58 | /// An iterator that walks over the shadow bytes corresponding to a memory |
60 | 59 | /// region. If there is no shadow for any given memory address, it just returns |
61 | 60 | /// null. |
62 | | -class ReadShadowIterator |
63 | | - : public std::iterator<std::bidirectional_iterator_tag, SymExpr> { |
| 61 | +class ReadShadowIterator { |
64 | 62 | public: |
65 | 63 | explicit ReadShadowIterator(uintptr_t address) |
66 | | - : std::iterator<std::bidirectional_iterator_tag, SymExpr>(), |
67 | | - address_(address), shadow_(getShadow(address)) {} |
| 64 | + : address_(address), shadow_(getShadow(address)) {} |
| 65 | + |
| 66 | + // The STL requires iterator types to expose the following type definitions |
| 67 | + // (see std::iterator_traits). Before C++17, it was possible to get them by |
| 68 | + // deriving from std::iterator, which is just an empty template struct with |
| 69 | + // five typedefs. However, std::iterator was deprecated in C++17 and hence its |
| 70 | + // use causes a warning in recent compilers. |
| 71 | + using iterator_category = std::bidirectional_iterator_tag; |
| 72 | + using value_type = SymExpr; |
| 73 | + using difference_type = ptrdiff_t; |
| 74 | + using pointer = SymExpr *; |
| 75 | + using reference = SymExpr &; |
68 | 76 |
|
69 | 77 | ReadShadowIterator &operator++() { |
70 | 78 | auto previousAddress = address_++; |
|
0 commit comments