Boost logo

Boost :

From: Stefan Slapeta (stefan_nospam__at_[hidden])
Date: 2004-07-19 10:04:32


David Abrahams wrote:

>
> No it does not, but it may cost you an extra bool in your iterator
> class.
>

Not necessary. Could anybody comment this fix (...and apply it if it's
ok)? Tests are fine.
BTW, the replace test doesn't compile at all with VC7.1+STLPort. I'll
have a look on that later.

Stefan

--- find_iterator.hpp 15 Jul 2004 21:48:25 -0000 1.8
+++ find_iterator.hpp 19 Jul 2004 14:41:19 -0000
@@ -136,14 +136,10 @@
              // comparison
              bool equal( const find_iterator& Other ) const
              {
- return
+ return eof() || Other.eof() ? eof() == Other.eof() :
                      (
                          m_Match==Other.m_Match &&
                          m_End==Other.m_End
- )
- ||
- (
- eof() && Other.eof()
                      );
              }

@@ -301,15 +297,11 @@
              // comparison
              bool equal( const split_iterator& Other ) const
              {
- return
+ return eof() || Other.eof() ? eof() == Other.eof() :
                      (
                          m_Match==Other.m_Match &&
                          m_Next==Other.m_Next &&
                          m_End==Other.m_End
- )
- ||
- (
- eof() && Other.eof()
                      );
              }


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk