Title
reverse_iterator is does not compile for fancy pointers
Status
dup
Section
[reverse.iter.elem]
Submitter
Billy Robert O'Neal III

Created on 2016-09-21.00:00:00 last changed 99 months ago

Messages

Date: 2016-10-08.04:58:13

Proposed resolution:

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->();
    
Date: 2017-02-02.00:41:18

[ Issues processing Telecon 2016-10-7 ]

Set status to Duplicate

Date: 2016-10-08.04:58:13

Duplicate: 1052

std::reverse_iterator<Iterator>::operator->() is specified to call addressof(operator*()), but it returns iterator_traits<Iterator>::pointer, which may be a fancy pointer type from which no conversion from T* is possible. It should instead delegate to the underlying iterator's operator->().

History
Date User Action Args
2016-10-08 04:58:13adminsetmessages: + msg8545
2016-10-08 04:58:13adminsetstatus: new -> dup
2016-10-03 15:44:01adminsetmessages: + msg8530
2016-09-21 00:00:00admincreate