diff options
author | Kartar Singh <kartarsingh@google.com> | 2023-04-11 11:38:29 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-04-11 11:38:29 +0000 |
commit | f5148ad7e332e2b882f019b26c9507d389e797cb (patch) | |
tree | c8d9f3b49931fb54728540b1bc7dc85046d04849 | |
parent | 1e2e45eaefc314f0c7e79b778ffd43f2761df63b (diff) | |
parent | c7158bc4b9f076faf306a7e47ce44036e4388032 (diff) | |
download | unwinding-f5148ad7e332e2b882f019b26c9507d389e797cb.tar.gz |
Remove std::iterator usage am: d6d1ee2a2c am: 16bd110abb am: aac48c21b3 am: c7158bc4b9
Original change: https://android-review.googlesource.com/c/platform/system/unwinding/+/2505923
Change-Id: I76c145922a53ba35576bf8f5df62ceef15e68f21
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)) { |