Boost logo

Boost Users :

Subject: Re: [Boost-users] [iterator] error while accessing member of result of brackets-operator
From: Sebastian Pfützner (s.pfuetzner_at_[hidden])
Date: 2014-01-10 04:54:26


On 09.01.2014 17:43, Krzysztof Czainski wrote:
> That said, here's a hack for you: right after the definition of struct S
> insert this code:
>
> class It;
>
> namespace boost { namespace detail {
> template <> struct operator_brackets_result<It,S,S&>
> { typedef S& type; };
> }}

That works in the example. In my real code, /It/ is a template and I
don't know how to specialize operator_brackets_result for each
instantiation.

Unfortunately, I can not change the algorithm, that accepts a
random-access-iterator of a certain class and uses it like in the
example. It is surprising, that my iterator is not a real
random-access-iterator and I don't see the difference to /(*(it +
n)).member/, which works.

-- 
Sebastian Pfützner
s.pfuetzner_at_[hidden]
ICQ-ID: 39965036

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