diff options
Diffstat (limited to 'src/set.h')
-rw-r--r-- | src/set.h | 33 |
1 files changed, 29 insertions, 4 deletions
@@ -322,7 +322,7 @@ namespace Bu | |||
322 | /** | 322 | /** |
323 | * Iterator equality comparison operator. Iterators the same? | 323 | * Iterator equality comparison operator. Iterators the same? |
324 | */ | 324 | */ |
325 | bool operator==( const iterator &oth ) | 325 | bool operator==( const iterator &oth ) const |
326 | { | 326 | { |
327 | if( bFinished != oth.bFinished ) | 327 | if( bFinished != oth.bFinished ) |
328 | return false; | 328 | return false; |
@@ -341,7 +341,7 @@ namespace Bu | |||
341 | /** | 341 | /** |
342 | * Iterator not equality comparison operator. Not the same? | 342 | * Iterator not equality comparison operator. Not the same? |
343 | */ | 343 | */ |
344 | bool operator!=( const iterator &oth ) | 344 | bool operator!=( const iterator &oth ) const |
345 | { | 345 | { |
346 | return !(*this == oth ); | 346 | return !(*this == oth ); |
347 | } | 347 | } |
@@ -366,6 +366,21 @@ namespace Bu | |||
366 | { | 366 | { |
367 | return hsh.getKeyAtPos( nPos ); | 367 | return hsh.getKeyAtPos( nPos ); |
368 | } | 368 | } |
369 | |||
370 | const key &operator *() const | ||
371 | { | ||
372 | return hsh.getKeyAtPos( nPos ); | ||
373 | } | ||
374 | |||
375 | bool isValid() const | ||
376 | { | ||
377 | return !bFinished; | ||
378 | } | ||
379 | |||
380 | operator bool() const | ||
381 | { | ||
382 | return !bFinished; | ||
383 | } | ||
369 | } iterator; | 384 | } iterator; |
370 | 385 | ||
371 | /** | 386 | /** |
@@ -420,7 +435,7 @@ namespace Bu | |||
420 | /** | 435 | /** |
421 | * Iterator equality comparison operator. Iterators the same? | 436 | * Iterator equality comparison operator. Iterators the same? |
422 | */ | 437 | */ |
423 | bool operator==( const const_iterator &oth ) | 438 | bool operator==( const const_iterator &oth ) const |
424 | { | 439 | { |
425 | if( bFinished != oth.bFinished ) | 440 | if( bFinished != oth.bFinished ) |
426 | return false; | 441 | return false; |
@@ -439,7 +454,7 @@ namespace Bu | |||
439 | /** | 454 | /** |
440 | * Iterator not equality comparison operator. Not the same? | 455 | * Iterator not equality comparison operator. Not the same? |
441 | */ | 456 | */ |
442 | bool operator!=( const const_iterator &oth ) | 457 | bool operator!=( const const_iterator &oth ) const |
443 | { | 458 | { |
444 | return !(*this == oth ); | 459 | return !(*this == oth ); |
445 | } | 460 | } |
@@ -464,6 +479,16 @@ namespace Bu | |||
464 | { | 479 | { |
465 | return hsh.getKeyAtPos( nPos ); | 480 | return hsh.getKeyAtPos( nPos ); |
466 | } | 481 | } |
482 | |||
483 | bool isValid() const | ||
484 | { | ||
485 | return !bFinished; | ||
486 | } | ||
487 | |||
488 | operator bool() const | ||
489 | { | ||
490 | return !bFinished; | ||
491 | } | ||
467 | } const_iterator; | 492 | } const_iterator; |
468 | 493 | ||
469 | /** | 494 | /** |