summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2018-02-27 07:47:54 -0800
committerMike Buland <mbuland@penny-arcade.com>2018-02-27 07:47:54 -0800
commit446d6d2a80638c7bf5dfcb1aa3fc1eb3a2c729ec (patch)
treed09411289254b9d3e697642ae0dcb5cf52186fc6
parente5f4c1fd2fb5402a637999f050fe64943ad2cfe9 (diff)
downloadlibbu++-446d6d2a80638c7bf5dfcb1aa3fc1eb3a2c729ec.tar.gz
libbu++-446d6d2a80638c7bf5dfcb1aa3fc1eb3a2c729ec.tar.bz2
libbu++-446d6d2a80638c7bf5dfcb1aa3fc1eb3a2c729ec.tar.xz
libbu++-446d6d2a80638c7bf5dfcb1aa3fc1eb3a2c729ec.zip
Added helper methods to Bu::List that were missing.
-rw-r--r--src/stable/list.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/stable/list.h b/src/stable/list.h
index 7e41581..5b5b7e9 100644
--- a/src/stable/list.h
+++ b/src/stable/list.h
@@ -703,11 +703,21 @@ namespace Bu
703 { 703 {
704 return *(pLink->pValue); 704 return *(pLink->pValue);
705 } 705 }
706
707 const value &operator*() const
708 {
709 return *(pLink->pValue);
710 }
706 711
707 const value *operator->() 712 const value *operator->()
708 { 713 {
709 return pLink->pValue; 714 return pLink->pValue;
710 } 715 }
716
717 const value *operator->() const
718 {
719 return pLink->pValue;
720 }
711 721
712 const_iterator &operator++() 722 const_iterator &operator++()
713 { 723 {
@@ -813,6 +823,17 @@ namespace Bu
813 return const_iterator( core->pFirst ); 823 return const_iterator( core->pFirst );
814 } 824 }
815 825
826 iterator rbegin()
827 {
828 _hardCopy();
829 return iterator( core->pLast );
830 }
831
832 const_iterator rbegin() const
833 {
834 return const_iterator( core->pLast );
835 }
836
816 /** 837 /**
817 * Get an iterator pointing to a place just past the last item in 838 * Get an iterator pointing to a place just past the last item in
818 * the list. 839 * the list.