|
Boost : |
Subject: Re: [boost] [gil::io] Feedback for scanline_read_iterator
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2013-02-25 00:25:23
Michael Marcin wrote:
> Jeffrey Lee Hellrung, Jr. wrote:
>> On Sun, Feb 24, 2013 at 1:07 PM, Christian Henning
>> <chhenning_at_[hidden]>wrote:
>>
>>> Hi Michael,
>>>
>>>>> I moved the buffer creation internally.
>>>>>
>>>>
>>>> I think this might be even worse unfortunately, if the iterator is
>>> copied, such
>>>> as with (*i++) it's going to make a full copy of the buffer. Now that
>>> readers
>>>> have a begin and end maybe the reader could own the buffer?
>>>
>>> I see two ways, apart from moving the buffer into the reader. I could
>>> use a shared ptr or the user has to pass the buffer into the
>>> constructor. I lean towards the shared pointer. Do you have an
>>> opinion?
>>>
>>
>> Does that mean all copies of an iterator share the same buffer? Won't
>> that
>> screw things up if iterators which share the same buffer are dereferenced
>> from different positions in the image?
>>
>
> I don't think that is a valid use case for an InputIterator.
>
Jeffrey Lee Hellrung, Jr. wrote:
> Or, maybe having a shared buffer is okay if your iterators are only
> advertised as input iterators or (equivalently, I think) readable +
> incrementable.
Ooops somhow missed this.
Yes I believe it is an InputIterator.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk