Date
2018-08-06.16:42:21
Message id
6212

Content

[ Original rationale: ]

The LWG did not reach a consensus for a change to the WP.

Previous resolution [SUPERSEDED]:

  1. In the class template reverse_iterator synopsis of [reverse.iterator] change as indicated:

    namespace std {
    template <class Iterator>
    class reverse_iterator : public
                 iterator<typename iterator_traits<Iterator>::iterator_category,
                 typename iterator_traits<Iterator>::value_type,
                 typename iterator_traits<Iterator>::difference_type,
                 typename iterator_traits<Iterator&>::pointer,
                 typename iterator_traits<Iterator>::reference> {
    public:
      [..]
      typedef typename iterator_traits<Iterator&>::pointer pointer;
      [..]
    protected:
      Iterator current;
    private:
      mutable Iterator deref_tmp; // exposition only
    };
    
  2. Change [reverse.iter.opref]/1 as indicated:
    pointer operator->() const;
    

    1 Returns Effects: &(operator*()).

    deref_tmp = current;
    --deref_tmp;
    return deref_tmp;
    
Alternate Proposed Resolution from 2775, which was closed as a dup of this issue

This wording is relative to N4606.

  1. Modify [reverse.iter.opref] as indicated:

    constexpr pointer operator->() const;
    

    -1- Returns: addressof(operator*()).Effects: If Iterator is a pointer type, as if by:

    Iterator tmp = current;
    return --tmp;
    

    Otherwise, as if by:

    Iterator tmp = current;
    --tmp;
    return tmp.operator->();