parse manipulator without abbreviation is not callable
Tomasz Kamiński

Created on 2019-07-10.00:00:00, last changed 2019-07-28.15:43:50.


Date: 2019-07-28.15:43:50

Proposed resolution:

This wording is relative to N4820.

[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-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
2019-07-28 15:43:50adminsetmessages: + msg10520
2019-07-10 00:00:00admincreate