parse manipulator without abbreviation is not callable
Tomasz Kamiński

Created on 2019-07-10.00:00:00 last changed 31 months ago


Date: 2019-08-17.12:20:24

Proposed resolution:

This wording is relative to N4830.

[Drafting note: As a drive-by fix the Remarks element is also converted to a Constraints element.]

  1. Modify [time.parse] as indicated:

    template<class charT, class traits, class Alloc, class Parsable>
        parse(const basic_string<charT, traits, Alloc>& fmt, Parsable& tp,
              minutes& offset);

    -6- RemarksConstraints: This function shall not participate in overload resolution unlessThe expression

    from_stream(declval<basic_istream<charT, traits>&>(), fmt.c_str(), tp, 
      declval<basic_string<charT, traits, Alloc>*>()nullptr, &offset)

    is a validwell-formed expressionwhen treated as an unevaluated operand.

    -7- Returns: A manipulator that, when extracted from a basic_istream<charT, traits> is, calls from_stream(is, fmt.c_str(), tp, static_cast<basic_string<charT, traits, Alloc>*>(nullptr), &offset).

Date: 2019-08-17.00:00:00

[ 2019-08-17 Issue Prioritization ]

Status to Tentatively Ready and priority to 0 after six positive votes on the reflector.

Date: 2019-07-10.00:00:00

The parse overload that does not accept the abbreviation but does accept an offset, because the expression in the Remarks: clause:

from_stream(declval<basic_istream<charT, traits>*>(), fmt.c_str(), tp, nullptr, &offset)

is not valid. This is caused by deduction failure for the basic_string<charT, traits, Alloc>* from nullptr (see this link):

Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2019-11-19 14:48:30adminsetstatus: voting -> wp
2019-10-07 02:48:00adminsetstatus: ready -> voting
2019-08-17 12:20:24adminsetmessages: + msg10557
2019-08-17 12:20:24adminsetstatus: new -> ready
2019-07-28 15:43:50adminsetmessages: + msg10520
2019-07-10 00:00:00admincreate