Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-08-15 14:46:36


From: "Peter Dimov" <pdimov_at_[hidden]>

> From: "David Abrahams" <dave_at_[hidden]>
> >
> > Any iterator which stores the referent of its operator* within the
> iterator
> > object is an example that causes serious memory problems if operator[]
> > returns a reference.
> >
> > That's a legal technique for random-access iterators.
> >
> > :(
>
> I see, the temporary is (a + n). I am a big fan of conciseness, but that
[4]
> footnote is over the top. :-)

Suggest some improved wording.

> Isn't this a defect report material?

I don't know, what would the defect be?

I don't want to outlaw those random-access iterators which store a value
internally. That can be the only practical way to get disk-based iteration,
for example.

I think Jeremy's new iterator categories have a cure for this. If they
don't, they should.

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


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