Re: [Boost-bugs] [Boost C++ Libraries] #10672: std::iterator_traits<boost::unordered_map<K, M>::iterator>::pointer should be value_type*, not detail::ptr_node<...>

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10672: std::iterator_traits<boost::unordered_map<K, M>::iterator>::pointer should be value_type*, not detail::ptr_node<...>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-22 20:21:41


#10672: std::iterator_traits<boost::unordered_map<K,M>::iterator>::pointer should
be value_type*, not detail::ptr_node<...>
-------------------------------+-------------------------
  Reporter: anonymous | Owner: danieljames
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: unordered
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+-------------------------
Changes (by danieljames):

 * status: new => assigned


Old description:

> The iterator type looks like:
>
> template <typename NodePointer, typename Value>
> struct iterator
> : public boost::iterator<
> std::forward_iterator_tag, Value, std::ptrdiff_t,
> NodePointer, Value&>
>
> The NodePointer argument here (which is
> boost::unordered::detail::ptr_node<...>) becomes the
> iterator_traits<>::pointer type.
>
> But iterator's operator->() returns Value *:
>
> Value* operator->() const {
> return &node_->value();
> }
>
> Seems like this should be changed.

New description:

 The iterator type looks like:
 {{{
 template <typename NodePointer, typename Value>
 struct iterator
     : public boost::iterator<
         std::forward_iterator_tag, Value, std::ptrdiff_t,
         NodePointer, Value&>
 }}}
 The `NodePointer` argument here (which is
 `boost::unordered::detail::ptr_node<...>`) becomes the
 `iterator_traits<>::pointer` type.

 But `iterator's operator->()` returns `Value *`:
 {{{
 Value* operator->() const {
     return &node_->value();
 }
 }}}

 Seems like this should be changed.

--
-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10672#comment:1>
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