Re: [Boost-bugs] [Boost C++ Libraries] #12895: VS 2012: zip_iterator dereference causes a compiler error

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12895: VS 2012: zip_iterator dereference causes a compiler error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-03-14 06:54:21


#12895: VS 2012: zip_iterator dereference causes a compiler error
--------------------------------+------------------------------
  Reporter: daniel.kruegler@… | Owner: jeffrey.hellrung
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: iterator
   Version: Boost 1.63.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------+------------------------------

Comment (by daniel.kruegler@…):

 The problem seems to be that
 `boost::iterators::detail::dereference_iterator`'s member template
 `result` gets as argument `Iterator` the effective type `char* const &`,
 therefore the operation sequence

 {{{
 typedef typename
           remove_reference<typename remove_cv<Iterator>::type>::type
         iterator;
 }}}

 doesn't do enough, it just reduces `Iterator` to `char* const`, therefore
 `std::iterator_traits<char* const>` instantiates the primary template
 instead of the partial specialization for pointers.

 Either one should prevent that a reference type is passed to this member
 template or the reduction code should be extended by adding an ''initial''
 reference removal:

 {{{
 typedef typename
           remove_reference<typename remove_cv<typename
           remove_reference<Iterator>::type>::type>::type
         iterator;
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12895#comment:3>
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-03-14 06:57:34 UTC