diff options
author | Kartar Singh <kartarsingh@google.com> | 2023-04-11 09:52:02 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-04-11 09:52:02 +0000 |
commit | 16bd110abb4bb0c9d96cba5f02890c4203e5b0c0 (patch) | |
tree | c8d9f3b49931fb54728540b1bc7dc85046d04849 | |
parent | 368005d2e551925ecfe624fd3f5a5f4c81b3089f (diff) | |
parent | d6d1ee2a2cc3a890c4f7f1ce7fddd96eecfd082a (diff) | |
download | unwinding-16bd110abb4bb0c9d96cba5f02890c4203e5b0c0.tar.gz |
Remove std::iterator usage am: d6d1ee2a2c
Original change: https://android-review.googlesource.com/c/platform/system/unwinding/+/2505923
Change-Id: I1a576b66b8de7590bebec2d98adc71cdd545b79f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | libunwindstack/ElfInterfaceArm.h | 9 | ||||
-rw-r--r-- | libunwindstack/include/unwindstack/DwarfSection.h | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/libunwindstack/ElfInterfaceArm.h b/libunwindstack/ElfInterfaceArm.h index 6ee6dc9..d8cad48 100644 --- a/libunwindstack/ElfInterfaceArm.h +++ b/libunwindstack/ElfInterfaceArm.h @@ -19,7 +19,6 @@ #include <elf.h> #include <stdint.h> -#include <iterator> #include <unordered_map> #include <unwindstack/ElfInterface.h> @@ -32,8 +31,14 @@ class ElfInterfaceArm : public ElfInterface32 { ElfInterfaceArm(Memory* memory) : ElfInterface32(memory) {} virtual ~ElfInterfaceArm() = default; - class iterator : public std::iterator<std::bidirectional_iterator_tag, uint32_t> { + class iterator { public: + using iterator_category = std::bidirectional_iterator_tag; + using value_type = uint32_t; + using difference_type = std::ptrdiff_t; + using pointer = uint32_t*; + using reference = uint32_t&; + iterator(ElfInterfaceArm* interface, size_t index) : interface_(interface), index_(index) { } iterator& operator++() { index_++; return *this; } diff --git a/libunwindstack/include/unwindstack/DwarfSection.h b/libunwindstack/include/unwindstack/DwarfSection.h index 33435b2..2318f2f 100644 --- a/libunwindstack/include/unwindstack/DwarfSection.h +++ b/libunwindstack/include/unwindstack/DwarfSection.h @@ -18,7 +18,6 @@ #include <stdint.h> -#include <iterator> #include <map> #include <optional> #include <unordered_map> @@ -42,8 +41,14 @@ class DwarfSection { DwarfSection(Memory* memory); virtual ~DwarfSection() = default; - class iterator : public std::iterator<std::bidirectional_iterator_tag, DwarfFde*> { + class iterator { public: + using iterator_category = std::bidirectional_iterator_tag; + using value_type = DwarfFde*; + using difference_type = std::ptrdiff_t; + using pointer = DwarfFde**; + using reference = DwarfFde*&; + iterator(DwarfSection* section, size_t index) : index_(index) { section->GetFdes(&fdes_); if (index_ == static_cast<size_t>(-1)) { |