aboutsummaryrefslogtreecommitdiff
path: root/src/list.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-12-19 07:12:31 +0000
committerMike Buland <eichlan@xagasoft.com>2009-12-19 07:12:31 +0000
commit8f5a78eabbbe94e5480078f4fdd29523be17398e (patch)
tree971fe2e4d5455063a1d84e6ad56a25297c6b304e /src/list.h
parent2cbc634b3b603ec67c6c312bd18177cd52c71b63 (diff)
downloadlibbu++-8f5a78eabbbe94e5480078f4fdd29523be17398e.tar.gz
libbu++-8f5a78eabbbe94e5480078f4fdd29523be17398e.tar.bz2
libbu++-8f5a78eabbbe94e5480078f4fdd29523be17398e.tar.xz
libbu++-8f5a78eabbbe94e5480078f4fdd29523be17398e.zip
Added a couple helpers, peekPop(), and an addition operator.
Diffstat (limited to 'src/list.h')
-rw-r--r--src/list.h14
1 files changed, 14 insertions, 0 deletions
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
239 append( src ); 239 append( src );
240 return *this; 240 return *this;
241 } 241 }
242
243 MyType operator+( const MyType &src )
244 {
245 MyType lNew( *this );
246 lNew += src;
247 return lNew;
248 }
242 249
243 bool operator==( const MyType &rhs ) const 250 bool operator==( const MyType &rhs ) const
244 { 251 {
@@ -303,6 +310,13 @@ namespace Bu
303 return *this; 310 return *this;
304 } 311 }
305 312
313 value peekPop()
314 {
315 value v = first();
316 pop();
317 return v;
318 }
319
306 value &peek() 320 value &peek()
307 { 321 {
308 return first(); 322 return first();