diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-12-19 07:12:31 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-12-19 07:12:31 +0000 |
commit | 8f5a78eabbbe94e5480078f4fdd29523be17398e (patch) | |
tree | 971fe2e4d5455063a1d84e6ad56a25297c6b304e | |
parent | 2cbc634b3b603ec67c6c312bd18177cd52c71b63 (diff) | |
download | libbu++-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 '')
-rw-r--r-- | src/list.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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(); |