Why is iterator_traits<unordered_map<K, M>>::pointer a detail::ptr_node type rather than value_type *?
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(); } Why shouldn't iterator_traits<>::pointer be Value* here? This detail::ptr_node<> type seems intended to be completely internal. Thanks, Alex
While eyes are on it, it should also use addressof as opposed to & On Oct 17, 2014 2:20 PM, "Daniel James" <dnljms@gmail.com> wrote:
On 17 October 2014 22:06, Alex Mohr <amohr@pixar.com> wrote:
Why shouldn't iterator_traits<>::pointer be Value* here?
I imagine that would be what is known as a bug.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
Alex Mohr
-
Daniel James
-
Matt Calabrese