Title
shared_ptr<int>& does not not satisfy readable
Status
resolved
Section
[iterator.concept.readable]
Submitter
Eric Niebler

Created on 2019-09-09.00:00:00 last changed 60 months ago

Messages

Date: 2019-11-19.16:46:06

Proposed resolution:

Resolved by P1878.

Date: 2019-11-19.14:48:30

[ 2019-11; Resolved by the adoption of P1878 in Belfast ]

Date: 2019-11-19.16:46:06

[ 2019-11 This should be resolved by P1878 ]

Previous resolution [SUPERSEDED]:

This wording is relative to N4830.

  1. Modify [iterator.concept.readable], concept readable synopsis, as indicated:

    template<class In>
      concept readable =
        requires {
          typename iter_value_t<remove_reference_t<In>>;
          typename iter_reference_t<In>;
          typename iter_rvalue_reference_t<In>;
        } &&
        common_reference_with<iter_reference_t<In>&&, iter_value_t<remove_reference_t<In>>&> &&
        common_reference_with<iter_reference_t<In>&&, iter_rvalue_reference_t<In>&&> &&
        common_reference_with<iter_rvalue_reference_t<In>&&, const iter_value_t<remove_reference_t<In>>&>;
    
Date: 2019-10-07.02:21:30

[ 2019-10 Priority set to 1 after reflector discussion ]

Date: 2019-09-09.00:00:00

In the current spec, shared_ptr<int> is readable, but shared_ptr<int>& is not. That is because readable_traits is not stripping top-level references before testing for nested typedefs.

Either readable_traits should see through cv- and ref-qualifiers, or else the readable concept should strip top-level references when building the iter_value_t associated type (e.g., iter_value_t<remove_reference_t<In>>).

Suggest priority P1 because it effects the definition of a concept which cannot change after C++20.

History
Date User Action Args
2019-11-19 14:48:30adminsetmessages: + msg10830
2019-11-19 14:48:30adminsetstatus: new -> resolved
2019-11-07 08:57:59adminsetmessages: + msg10789
2019-10-07 02:21:30adminsetmessages: + msg10682
2019-09-15 12:57:21adminsetmessages: + msg10629
2019-09-09 00:00:00admincreate