Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2002-02-05 10:57:37


On Tuesday 05 February 2002 16:37, you wrote:
> In increment:
>
> if( ++x.base() == m_bounds.second )
> x.base() = m_bounds.first;
>
>
> Since m_bounds.second is not included in the range, shouldn't that be:
>
> if( x.base()++ == m_bounds.second )
> x.base() = m_bounds.first;
>

I don't think so. AFAICS

if( x.base()++ == m_bounds.second )

would not prevent us fom incrementing the end iterator.

It is

if( ++x.base() == m_bounds.second )
            x.base() = m_bounds.first;

because m_bounds.second is not included in the range so we have to make
sure base does not point to m_bounds.second.

As I am writing this: If you question was should m_bounds.second be a valid
position for the cyclic iterator? I think no. To me providing a half open
range to the policies constructor is the right way to go. Otherwise we would
surely confuse users.

Thomas

> Info: http://www.boost.org Send unsubscribe requests to:
> <mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

-- 
Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
http://www.ive.uni-hannover.de

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