From 4f97cedf9abd647cdd6243d5526c7f776310cee8 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 6 May 2011 20:13:37 +0000 Subject: Added find operators to list. --- src/list.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/list.h') 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 return *this; } + iterator find( const value &v ) + { + for( iterator i = begin(); i; i++ ) + { + if( (*i) == v ) + return i; + } + + return end(); + } + + const_iterator find( const value &v ) const + { + for( const_iterator i = begin(); i; i++ ) + { + if( (*i) == v ) + return i; + } + + return end(); + } + /** * Get the current size of the list. *@returns (int) The current size of the list. -- cgit v1.2.3