[Boost-bugs] [Boost C++ Libraries] #10769: iterator_adaptor does not properly inherit "pointer" typedef from the base iterator

Subject: [Boost-bugs] [Boost C++ Libraries] #10769: iterator_adaptor does not properly inherit "pointer" typedef from the base iterator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-11-07 20:03:37


#10769: iterator_adaptor does not properly inherit "pointer" typedef from the base
iterator
-----------------------------------+------------------------------
 Reporter: Matei David <matei@…> | Owner: jeffrey.hellrung
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: iterator
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
-----------------------------------+------------------------------
 I'm trying to define a `Derived_Iterator` class using a `Base_Iterator`
 class and the glue class `iterator_adaptor< Derived_Class, Base_Class,
 ...>` (as base of `Derived_Iterator`). In my use case, neither pointers
 nor references are plain:
 {{{
 Base_Iterator::pointer != Base_Iterator::value_type*
 Base_Iterator::reference != Base_Iterator::value_type&
 }}}

 I found 2 possibly related problems, which I think are bugs:

 1. The typedef `iterator_adaptor<>::pointer` is incorrect. Specifically,
 it produces a plain pointer, when I expect it to produce
 `Base_Iterator::pointer`.

 2. There is something wrong with `iterator_adaptor<>::operator->()`. I
 would expect `Derived_Iterator` to behave exactly like `Base_Iterator`.
 So, if I don't explicitly define `Derived_Iterator::operator->()`, I would
 expect the version inherited from `iterator_adaptor<>` to do something
 similar to:
 {{{
 Base_Iterator operator->() const { return this->base(); }
 }}}
 But this doesn't happen. If I put in this definition explicitly in
 `Derived_Iterator`, then the code works.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10769>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC