From 8f5a78eabbbe94e5480078f4fdd29523be17398e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 19 Dec 2009 07:12:31 +0000 Subject: Added a couple helpers, peekPop(), and an addition operator. --- src/list.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/list.h b/src/list.h index 2e6280c..c673cec 100644 --- a/src/list.h +++ b/src/list.h @@ -239,6 +239,13 @@ namespace Bu append( src ); return *this; } + + MyType operator+( const MyType &src ) + { + MyType lNew( *this ); + lNew += src; + return lNew; + } bool operator==( const MyType &rhs ) const { @@ -303,6 +310,13 @@ namespace Bu return *this; } + value peekPop() + { + value v = first(); + pop(); + return v; + } + value &peek() { return first(); -- cgit v1.2.3