From: David Abrahams (dave_at_[hidden])
Date: 2002-11-19 12:46:48
"Bohdan" <warever_at_[hidden]> writes:
> Do you mean that *i returns proxy (not object or reference) ?
> Can you give some link where i can find rationale for this ?
A rationale? No, "them's the rules". The reasons why don't matter much
> (except standart paper) I know there were talks about it in boost,
> but i'm not sure i can easyly find this thread.
You can read all about the subtleties of iterator requirements in the
iterator adaptors paper:
>> The way to make random access iterators over disk storage is to build
>> an iterator which stores its value_type internally. You can even
>> arrange for it to construct the value_type in its internal storage on
>> demand, so that it doesn't store anything until it is dereferenced.
> I was trying to convince Wesley to this approach but it is not easy
> :) He claims that it is much easier to return proxy and serialize /
> deserialize on assignment and cast, but I have feeling that it is
> blind alley for stl on disk.
You're right. It's not much good to provide sort-of-iterator things
that break down when you try to use them in algorithms which are
legitimately assuming real iterators.
-- David Abrahams dave_at_[hidden] * http://www.boost-consulting.com Boost support, enhancements, training, and commercial distribution
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk