Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost][iterator] Regarding Ticket #11847
From: alex (alexhighviz_at_[hidden])
Date: 2015-12-23 09:25:21


> From: Gagan Kumar
> Sent: 23 December 2015 10:10
>
> Hi,
> I am new and I wanted to contribute.
> The ticker #11847 says,"reference typedef no longer available in parent class of
> iterator_facade" but actually I think reference is available in class
> iterator_facade itself(boost/iterator/iterator_facade.hpp).
>
> But still we are not able to use reference in class simple_iterator : public
> boost::iterator_facade<simple_iterator<T>, T, boost::forward_traversal_tag>
> and then after a while I saw this
> http://stackoverflow.com/questions/1643035/propagating-typedef-from-
> based-to-derived-class-for-template
>
> From my side I can only solve this kind of problem by
>
> using typename boost::iterators::iterator_facade<simple_iterator<T>, T,
> boost::iterators::forward_traversal_tag>::reference;
>
> or using alternative of reference as
>
> T& dereference() const { return *m_iter; } //T& instead of reference, as stated
> in Ticket
>
>
> Can somebody please tell me or guide me to a better way to solve this problem.
>

Thank you for looking into this.

The two solutions that you suggest both are in the user code and do not require a fix in Boost. Based on your findings, I would say that the bug needs to be closed as "won't fix": The regression that the user (me) experienced only occurred because the original code happened to work under a non-conformant compiler.


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