- class const_iterator : public PackageContainerInterface::const_iterator,/*{{{*/
- public std::iterator<typename std::iterator_traits<typename Container::const_iterator>::iterator_category, typename Container::const_iterator> {
- typedef typename Container::const_iterator container_iterator;
- container_iterator _iter;
- typedef const_iterator iterator_type;
- public:
- explicit const_iterator(container_iterator i) : _iter(i) {}
- inline pkgCache::PkgIterator getPkg(void) const { return *_iter; }
- inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
- operator container_iterator(void) const { return _iter; }
- inline iterator_type& operator++() { ++_iter; return *this; }
- inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; }
- inline iterator_type operator+(typename iterator_type::difference_type const &n) { return iterator_type(_iter + n); }
- inline iterator_type operator+=(typename iterator_type::difference_type const &n) { _iter += n; return *this; }
- inline iterator_type& operator--() { --_iter; return *this; }
- inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; }
- inline iterator_type operator-(typename iterator_type::difference_type const &n) { return iterator_type(_iter - n); }
- inline iterator_type operator-=(typename iterator_type::difference_type const &n) { _iter -= n; return *this; }
- inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; }
- inline bool operator==(iterator_type const &i) const { return _iter == i._iter; }
- inline bool operator<(iterator_type const &i) const { return _iter < i._iter; }
- inline bool operator>(iterator_type const &i) const { return _iter > i._iter; }
- inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; }
- inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; }
- inline typename iterator_type::reference operator[](typename iterator_type::difference_type const &n) const { return _iter[n]; }
-
- friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); }
- friend class PackageContainer<Container>;
- };
- class iterator : public PackageContainerInterface::const_iterator,
- public std::iterator<typename std::iterator_traits<typename Container::iterator>::iterator_category, typename Container::iterator> {
- typedef typename Container::iterator container_iterator;
- container_iterator _iter;
- typedef iterator iterator_type;
- public:
- explicit iterator(container_iterator i) : _iter(i) {}
- inline pkgCache::PkgIterator getPkg(void) const { return *_iter; }
- inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
- operator container_iterator(void) const { return _iter; }
- inline iterator_type& operator++() { ++_iter; return *this; }
- inline iterator_type operator++(int) { iterator_type tmp(*this); operator++(); return tmp; }
- inline iterator_type operator+(typename iterator_type::difference_type const &n) { return iterator_type(_iter + n); }
- inline iterator_type operator+=(typename iterator_type::difference_type const &n) { _iter += n; return *this; }
- inline iterator_type& operator--() { --_iter; return *this; }
- inline iterator_type operator--(int) { iterator_type tmp(*this); operator--(); return tmp; }
- inline iterator_type operator-(typename iterator_type::difference_type const &n) { return iterator_type(_iter - n); }
- inline iterator_type operator-=(typename iterator_type::difference_type const &n) { _iter -= n; return *this; }
- inline bool operator!=(iterator_type const &i) const { return _iter != i._iter; }
- inline bool operator==(iterator_type const &i) const { return _iter == i._iter; }
- inline bool operator<(iterator_type const &i) const { return _iter < i._iter; }
- inline bool operator>(iterator_type const &i) const { return _iter > i._iter; }
- inline bool operator<=(iterator_type const &i) const { return _iter <= i._iter; }
- inline bool operator>=(iterator_type const &i) const { return _iter >= i._iter; }
- inline typename iterator_type::reference operator[](typename iterator_type::difference_type const &n) const { return _iter[n]; }
-
- operator typename PackageContainer<Container>::const_iterator() { return typename PackageContainer<Container>::const_iterator(_iter); }
- inline iterator& operator=(iterator_type const &i) { _iter = i._iter; return *this; }
- inline iterator& operator=(container_iterator const &i) { _iter = i; return *this; }
-
- friend std::ostream& operator<<(std::ostream& out, iterator_type i) { return operator<<(out, *i); }
- friend class PackageContainer<Container>;
- };
- /*}}}*/
-
- bool insert(pkgCache::PkgIterator const &P) { if (P.end() == true) return false; _cont.insert(P); return true; }
+ typedef Container_const_iterator<PackageContainerInterface, Container, PackageContainer> const_iterator;
+ typedef Container_iterator<PackageContainerInterface, Container, PackageContainer> iterator;
+ typedef Container_const_reverse_iterator<PackageContainerInterface, Container, PackageContainer> const_reverse_iterator;
+ typedef Container_reverse_iterator<PackageContainerInterface, Container, PackageContainer> reverse_iterator;
+ typedef typename Container::value_type value_type;
+ typedef typename Container::pointer pointer;
+ typedef typename Container::const_pointer const_pointer;
+ typedef typename Container::reference reference;
+ typedef typename Container::const_reference const_reference;
+ typedef typename Container::difference_type difference_type;
+ typedef typename Container::size_type size_type;
+ typedef typename Container::allocator_type allocator_type;
+
+ bool insert(pkgCache::PkgIterator const &P) APT_OVERRIDE { if (P.end() == true) return false; _cont.insert(P); return true; }