aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-11 13:59:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-11 13:59:45 +0000
commita45a81f92f9c1c0a9bcfd1a8c790d9f76c60888c (patch)
treef33b3981f7c8b2cda76c7e6bd33b9e5096a55c5d
parentad1cce1f7808420fb4f6ec5290da49ab323a7e8d (diff)
downloadpaludis-a45a81f92f9c1c0a9bcfd1a8c790d9f76c60888c.tar.gz
paludis-a45a81f92f9c1c0a9bcfd1a8c790d9f76c60888c.tar.xz
Make ourselves a real container by defining our container type
-rw-r--r--paludis/util/collection.hh9
1 files changed, 7 insertions, 2 deletions
diff --git a/paludis/util/collection.hh b/paludis/util/collection.hh
index d5113a1..11bf719 100644
--- a/paludis/util/collection.hh
+++ b/paludis/util/collection.hh
@@ -23,6 +23,7 @@
#include <algorithm>
#include <list>
#include <set>
+#include <iterator>
#include <paludis/util/counted_ptr.hh>
#include <paludis/util/instantiation_policy.hh>
@@ -35,7 +36,9 @@ namespace paludis
template <typename T_>
class SequentialCollection :
private InstantiationPolicy<SequentialCollection<T_>, instantiation_method::NonCopyableTag>,
- public InternalCounted<SequentialCollection<T_> >
+ public InternalCounted<SequentialCollection<T_> >,
+ public std::iterator<typename std::iterator_traits<
+ typename std::list<T_>::const_iterator>::iterator_category, T_>
{
private:
std::list<T_> _items;
@@ -120,7 +123,9 @@ namespace paludis
template <typename T_>
class SortedCollection :
private InstantiationPolicy<SortedCollection<T_>, instantiation_method::NonCopyableTag>,
- public InternalCounted<SortedCollection<T_> >
+ public InternalCounted<SortedCollection<T_> >,
+ public std::iterator<typename std::iterator_traits<
+ typename std::set<T_>::const_iterator>::iterator_category, T_>
{
private:
std::set<T_> _items;