Date
2021-10-14.09:56:08
Message id
12145

Content

Proposed resolution:

This wording is relative to N4892.

  1. Modify [common.iter.access] as indicated:

    decltype(auto) operator->() const
      requires see below;
    

    -3- […]

    -4- […]

    -5- Effects:

    1. (5.1) — […]

    2. (5.2) — […]

    3. (5.3) — Otherwise, equivalent to: return proxy(*get<I>(v_)); where proxy is the exposition-only class:

      class proxy {
        iter_value_t<I> keep_;
        constexpr proxy(iter_reference_t<I>&& x)
          : keep_(std::move(x)) {}
      public:
        constexpr const iter_value_t<I>* operator->() const noexcept {
          return addressof(keep_);
        }
      };
      
  2. Modify [common.iter.nav] as indicated:

    decltype(auto) operator++(int);
    

    -4- […]

    -5- Effects: If I models forward_iterator, equivalent to:

    […]

    Otherwise, if […]

    […]

    Otherwise, equivalent to:

    postfix-proxy p(**this);
    ++*this;
    return p;
    

    where postfix-proxy is the exposition-only class:

    class postfix-proxy {
      iter_value_t<I> keep_;
      constexpr postfix-proxy(iter_reference_t<I>&& x)
        : keep_(std::forward<iter_reference_t<I>>(x)) {}
    public:
      constexpr const iter_value_t<I>& operator*() const noexcept {
        return keep_;
      }
    };