Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-08-27 13:31:59


suppose I start at position 1 in row-major storage:

+--+--+--+
| | |1 |
+--+--+--+
| | |2 |
+--+--+--+
    XX 3

Forming a one-past-the end iterator requires forming an iterator to position
3, which is (for pointers and all other iterators I know of) undefined
behavior unless position XX has storage allocated.

-Dave
----- Original Message -----
From: "Fernando Cacciola" <fcacciola_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, August 27, 2001 11:07 AM
Subject: RE: [boost] stride_iterator_policy

>
> ----- Original Message -----
> From: David Abrahams <david.abrahams_at_[hidden]>
> To: Boost_at_Yahoogroups. Com <boost_at_[hidden]>
> Sent: Monday, August 27, 2001 11:12 AM
> Subject: Re: [boost] stride_iterator_policy
>
>
> >[snip]
> >
> > An intersting fact about striding over matrices: to avoid undefined
> behavior
> > you usually need to allocate an extra row (or column) so that there's a
> > valid end iterator position.
> >
> I don't follow you here.
>
> What would be the value of that extra row or column? I figure that the
> iterator could recognize that it reached the end of a row/column by
> recognizing this *special* value, but since there is no way to determine
> which value can be used to signal this I don't see how allocating an extra
> row/col would work.
>
> Fernando Cacciola
> Sierra s.r.l.
> fcacciola_at_[hidden]
> www.gosierra.com
>
>
>
> Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


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