Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-12-01 10:15:23


----- Original Message -----
From: "Ullrich Koethe" <koethe_at_[hidden]>
> David Abrahams wrote:
> >
> > Okay, I understand what you're getting at here.
> > Should cursor() be renamed as_sequence()?
> >
>
> I don't think so. For me, 'as_sequence()' intuitivly implies that the
> container is somehow converted.

Not converted in this case, but wrapped and re-presented. And that's true,
in a sense. You can index the result, and presumably, ask about its length.

> I've choosen cursor to mean 'similar to
> an iterator, but slighly different'
>
> > Does the documentation need a warning about the dangers of modifying the
> > container during iteration?
> >
>
> Good point. Can we simply carry C++ sematics through, or are there
> situations where this fails?

I don't know what you mean. I think you'll have to be more specific. If you
mean, "could we say, 'the result contains an iterator and a reference to the
container; beware you don't do anything to invalidate the iterator (e.g.
clear() the container) while the iterator is still in use.' ", then yes.

-Dave


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