Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-01-10 09:12:33


Jens Theisen wrote:
> Hello,
>
> I want to use indirect_iterator and noticed that it subscript operator
> returns a proxy.
>
> I found the following explanation in iterator_facade.h:
>
> // A proxy return type for operator[], needed to deal with
> // iterators that may invalidate referents upon destruction.
> // Consider the temporary iterator in *(a + n)
>
> But I still don't understand why a proxy is necessary in some cases.

http://www.boost.org/libs/iterator/doc/iterator_facade.html#operator

explains all.

HTH,

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net