Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=fbbe0b86d363deb214567f080f173485f57e532e

commit fbbe0b86d363deb214567f080f173485f57e532e
Author: Michel Hermier <[email protected]>
Date:   Tue Sep 9 11:39:35 2014 +0200

libpacman: Make FPtrList a little bit more correct with return types.

diff --git a/lib/libpacman/util/fptrlist.h b/lib/libpacman/util/fptrlist.h
index 1d5402b..c72ec84 100644
--- a/lib/libpacman/util/fptrlist.h
+++ b/lib/libpacman/util/fptrlist.h
@@ -79,7 +79,9 @@ public:
friend FPtrList *f_ptrlist_add_sorted(FPtrList *list, void *data, 
_pacman_fn_cmp fn);

typedef FPtrListItem *iterator;
-       typedef const iterator const_iterator;
+       typedef iterator const_iterator;
+       typedef iterator reverse_iterator;
+       typedef iterator const_reverse_iterator;

FPtrList()
: FCListItem(this, this)
@@ -144,34 +146,34 @@ public:
return const_iterator(previous());
}

-       iterator rbegin()
+       reverse_iterator rbegin()
{
-               return last();
+               return reverse_iterator(previous());
}

-       const_iterator rbegin() const
+       const_reverse_iterator rbegin() const
{
-               return last();
+               return crbegin();
}

-       const_iterator crbegin() const
+       const_reverse_iterator crbegin() const
{
-               return last();
+               return const_reverse_iterator(previous());
}

-       iterator rend()
+       reverse_iterator rend()
{
-               return iterator(this);
+               return reverse_iterator(this);
}

-       const_iterator rend() const
+       const_reverse_iterator rend() const
{
return crend();
}

-       const_iterator crend() const
+       const_reverse_iterator crend() const
{
-               return const_iterator(this);
+               return const_reverse_iterator(this);
}

bool empty() const
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to