Boost logo

Boost :

From: Jeremy Maitin-Shepard (jbms_at_[hidden])
Date: 2005-08-18 16:53:37


David Abrahams <dave_at_[hidden]> writes:

> "Thorsten Ottosen" <nesotto_at_[hidden]> writes:
>> Then why do all the examples work on statically sized arrays?
>>
>> If we're not working on statically sized arrays, then why not use vector?
>>
>> I'm not convinced about any overhead noticable associated wirh vector.
>>
>> Besides, both versions could be provided.

> Why not just provide a standard iterator interface so that you can
> write to anything you like?

All operating systems with which I am familiar only support reading and
writing from memory ranges. Thus, if the iterators are actually
pointers, this can be implemented efficiently. If they are not
pointers, though, a temporary buffer will have to be allocated, the
actual read performed using this temporary buffer, and then the data
copied to the output iterator provided by the user. Because of this
inefficiency, I doubt anyone would actually use the iterator interface
with non-pointers.

-- 
Jeremy Maitin-Shepard

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