Boost logo

Boost :

Subject: Re: [boost] [gil] Is bit_aligned_pixel_iterator a standard conformant random access iterator?
From: David Abrahams (dave_at_[hidden])
Date: 2010-06-01 11:10:14

At Mon, 31 May 2010 12:09:56 -0700,
Lubomir Bourdev wrote:
> On 5/31/10 5:33 AM, "David Abrahams" <dave_at_[hidden]> wrote:
> > At Sun, 30 May 2010 16:27:29 -1000,
> > Christian Henning wrote:
> >>
> >> One of the folks over at MSDN thinks that bit_aligned_pixel_iterator
> >> isn't implemented correctly with the interator_facade. He/She also
> >> thinks that iterator isn't fully standard compliant since it doesn't
> >> give a real reference but a proxy object instead when deferencing. I'm
> >> not sure if that's correct. Anyone knows if that's true or not.
> >
> > It is indeed correct that ForwardIterator (and thus
> > RandomAccessIterator) forbids the use of proxy references. That
> > restriction is supposed to be dropped in C++0x.
> >
> That is unfortunate because in many places in GIL we require a proxy
> reference - such as dereferencing a planar pixel, for example. I don't see a
> way to avoid having proxy references... And we do want GIL iterators to be
> random access iterators.

Well fortunately, *most* standard libraries have done *some* work to
accomodate such iterators in their algorithms. This might be a good
reason to duplicate some of the STL's algorithms in boost::algorithm.

Dave Abrahams
BoostPro Computing

Boost list run by bdawes at, gregod at, cpdaniel at, john at