]> git.saurik.com Git - apt.git/commitdiff
fix the operator++ implementations in the cachesets
authorDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 22 Nov 2011 20:54:32 +0000 (21:54 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 22 Nov 2011 20:54:32 +0000 (21:54 +0100)
apt-pkg/cacheset.h

index a23659efbb5c6beed35a05b55fec8c850afe3175..d1e396e0f1dae5d6d79b806a81a69a7d765daac0 100644 (file)
@@ -168,7 +168,8 @@ public:                                                                     /*{{{*/
                pkgCache::PkgIterator getPkg(void) const { return *_iter; }
                inline pkgCache::PkgIterator operator*(void) const { return *_iter; };
                operator typename Container::const_iterator(void) const { return _iter; }
-               inline void operator++(void) { ++_iter; };
+               inline const_iterator& operator++() { ++_iter; return *this; }
+               inline const_iterator operator++(int) { const_iterator tmp(*this); operator++(); return tmp; }
                inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; };
                inline bool operator==(const_iterator const &i) const { return _iter == i._iter; };
                friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); }
@@ -182,7 +183,8 @@ public:                                                                     /*{{{*/
                inline pkgCache::PkgIterator operator*(void) const { return *_iter; };
                operator typename Container::iterator(void) const { return _iter; }
                operator typename PackageContainer<Container>::const_iterator() { return PackageContainer<Container>::const_iterator(_iter); }
-               inline void operator++(void) { ++_iter; };
+               inline iterator& operator++() { ++_iter; return *this; }
+               inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
                inline bool operator!=(iterator const &i) const { return _iter != i._iter; };
                inline bool operator==(iterator const &i) const { return _iter == i._iter; };
                friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); }
@@ -482,7 +484,8 @@ public:                                                                     /*{{{*/
                pkgCache::VerIterator getVer(void) const { return *_iter; }
                inline pkgCache::VerIterator operator*(void) const { return *_iter; };
                operator typename Container::const_iterator(void) const { return _iter; }
-               inline void operator++(void) { ++_iter; };
+               inline const_iterator& operator++() { ++_iter; return *this; }
+               inline const_iterator operator++(int) { const_iterator tmp(*this); operator++(); return tmp; }
                inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; };
                inline bool operator==(const_iterator const &i) const { return _iter == i._iter; };
                friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); }
@@ -496,7 +499,8 @@ public:                                                                     /*{{{*/
                inline pkgCache::VerIterator operator*(void) const { return *_iter; };
                operator typename Container::iterator(void) const { return _iter; }
                operator typename VersionContainer<Container>::const_iterator() { return VersionContainer<Container>::const_iterator(_iter); }
-               inline void operator++(void) { ++_iter; };
+               inline iterator& operator++() { ++_iter; return *this; }
+               inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
                inline bool operator!=(iterator const &i) const { return _iter != i._iter; };
                inline bool operator==(iterator const &i) const { return _iter == i._iter; };
                friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); }