aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-05-06 20:13:37 +0000
committerMike Buland <eichlan@xagasoft.com>2011-05-06 20:13:37 +0000
commit4f97cedf9abd647cdd6243d5526c7f776310cee8 (patch)
tree44a15f756927d8f3806ac21c44f0b4dfea768b38
parentf504a6c9ae3634799d36963aeea82160b2f10920 (diff)
downloadlibbu++-4f97cedf9abd647cdd6243d5526c7f776310cee8.tar.gz
libbu++-4f97cedf9abd647cdd6243d5526c7f776310cee8.tar.bz2
libbu++-4f97cedf9abd647cdd6243d5526c7f776310cee8.tar.xz
libbu++-4f97cedf9abd647cdd6243d5526c7f776310cee8.zip
Added find operators to list.
-rw-r--r--src/list.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/list.h b/src/list.h
index 560dfd9..c678d68 100644
--- a/src/list.h
+++ b/src/list.h
@@ -871,6 +871,28 @@ namespace Bu
871 return *this; 871 return *this;
872 } 872 }
873 873
874 iterator find( const value &v )
875 {
876 for( iterator i = begin(); i; i++ )
877 {
878 if( (*i) == v )
879 return i;
880 }
881
882 return end();
883 }
884
885 const_iterator find( const value &v ) const
886 {
887 for( const_iterator i = begin(); i; i++ )
888 {
889 if( (*i) == v )
890 return i;
891 }
892
893 return end();
894 }
895
874 /** 896 /**
875 * Get the current size of the list. 897 * Get the current size of the list.
876 *@returns (int) The current size of the list. 898 *@returns (int) The current size of the list.