summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheiterators.h
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2022-03-21 06:02:47 +0100
committerJulian Andres Klode <jak@debian.org>2022-03-21 09:11:33 +0100
commit84f5ff06f0c7dbe10f5ec8452521bd79262bc05b (patch)
tree746b80486e4e28f8f5b56f947b46a48b2ab3f492 /apt-pkg/cacheiterators.h
parent70f0f4e61169bfbfe2c3eef82714eec4450ffe38 (diff)
Avoid use of deprecated std::iterator (twice)
Closes: #1008036
Diffstat (limited to 'apt-pkg/cacheiterators.h')
-rw-r--r--apt-pkg/cacheiterators.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index 466492442..9273369bd 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -44,8 +44,7 @@
// abstract Iterator template /*{{{*/
/* This template provides the very basic iterator methods we
need to have for doing some walk-over-the-cache magic */
-template<typename Str, typename Itr> class APT_PUBLIC pkgCache::Iterator :
- public std::iterator<std::forward_iterator_tag, Str> {
+template<typename Str, typename Itr> class APT_PUBLIC pkgCache::Iterator {
/** \brief Returns the Pointer for this struct in the owner
* The implementation of this method should be pretty short
* as it will only return the Pointer into the mmap stored
@@ -61,6 +60,12 @@ template<typename Str, typename Itr> class APT_PUBLIC pkgCache::Iterator :
pkgCache *Owner;
public:
+ // iterator_traits
+ using iterator_category = std::forward_iterator_tag;
+ using value_type = Str;
+ using difference_type = std::ptrdiff_t;
+ using pointer = Str*;
+ using reference = Str&;
// Iteration
inline bool end() const {return Owner == 0 || S == OwnerPointer();}