Created on 2019-09-01.00:00:00 last changed 46 months ago
Proposed resolution:
This wording is relative to N4849.
Modify [time.parse] as indicated:
-1- Each parse overload specified in this subclause calls from_stream unqualified, so as to enable argument dependent lookup ([basic.lookup.argdep]). In the following paragraphs, let is denote an object of type basic_istream<charT, traits> and let I be basic_istream<charT, traits>&, where charT and traits are template parameters in that context.
template<class charT, class traits, class Alloc, class Parsable> unspecified parse(const basic_string<charT, traits, Alloc>& fmt, Parsable& tp);-2- Constraints: The expression
isfrom_stream(declval<basic_istream<charT, traits>&>(), fmt.c_str(), tp)a valid expressionwell-formed when treated as an unevaluated operand. -3- Returns: A manipulator such that, when extracted from a basic_istream<charT, traits> is,the expression is >> parse(fmt, tp) has type I, value is, and calls from_stream(is, fmt.c_str(), tp).template<class charT, class traits, class Alloc, class Parsable> unspecified parse(const basic_string<charT, traits, Alloc>& fmt, Parsable& tp, basic_string<charT, traits, Alloc>& abbrev);-4- Constraints: The expression
isfrom_stream(declval<basic_istream<charT, traits>&>(), fmt.c_str(), tp, addressof(abbrev))a valid expressionwell-formed when treated as an unevaluated operand. -5- Returns: A manipulator such that, when extracted from a basic_istream<charT, traits> is,the expression is >> parse(fmt, tp, abbrev) has type I, value is, and calls from_stream(is, fmt.c_str(), tp, addressof(abbrev)).template<class charT, class traits, class Alloc, class Parsable> unspecified parse(const basic_string<charT, traits, Alloc>& fmt, Parsable& tp, minutes& offset);-6- Constraints: The expression
is well-formed when treated as an unevaluated operand. -7- Returns: A manipulator such thatfrom_stream(declval<basic_istream<charT, traits>&>(), fmt.c_str(), tp, declval<basic_string<charT, traits, Alloc>*>(), &offset), when extracted from a basic_istream<charT, traits> is,the expression is >> parse(fmt, tp, offset) has type I, value is, and callsfrom_stream(is, fmt.c_str(), tp, static_cast<basic_string<charT, traits, Alloc>*>(nullptr), &offset)template<class charT, class traits, class Alloc, class Parsable> unspecified parse(const basic_string<charT, traits, Alloc>& fmt, Parsable& tp, basic_string<charT, traits, Alloc>& abbrev, minutes& offset);-8- Constraints: The expression
isfrom_stream(declval<basic_istream<charT, traits>&>(), fmt.c_str(), tp, addressof(abbrev), &offset)a valid expressionwell-formed when treated as an unevaluated operand. -9- Returns: A manipulator such that, when extracted from a basic_istream<charT, traits> is,the expression is >> parse(fmt, tp, abbrev, offset) has type I, value is, and calls from_stream(is, fmt.c_str(), tp, addressof(abbrev), &offset).
[ 2020-02 Status to Immediate on Friday morning in Prague. ]
[ 2020-02-13, Prague ]
Issue wording has been rebased.
[ 2019-10 Priority set to 2 after reflector discussion ]
Previous resolution [SUPERSEDED]:This wording is relative to N4830.
[Drafting note: As a drive-by fix the Remarks element is also converted to a Constraints element. The wording integrates the resolution for LWG 3235.
Modify [time.parse] as indicated:
-1- Each parse overload specified in this subclause calls from_stream unqualified, so as to enable argument dependent lookup ([basic.lookup.argdep]). In the following paragraphs, let is denote an object of type basic_istream<charT, traits> and let I be basic_istream<charT, traits>&, where charT and traits are template parameters in that context.
template<class charT, class traits, class Alloc, class Parsable> unspecified parse(const basic_string<charT, traits, Alloc>& fmt, Parsable& tp);-2-
RemarksConstraints:This function shall not participate in overload resolution unlessThe expressionisfrom_stream(declval<basic_istream<charT, traits>&>(), fmt.c_str(), tp)a valid expressionwell-formed when treated as an unevaluated operand. -3- Returns: A manipulator such that, when extracted from a basic_istream<charT, traits> is,the expression is >> parse(fmt, tp) has type I, value is, and calls from_stream(is, fmt.c_str(), tp).template<class charT, class traits, class Alloc, class Parsable> unspecified parse(const basic_string<charT, traits, Alloc>& fmt, Parsable& tp, basic_string<charT, traits, Alloc>& abbrev);-4-
RemarksConstraints:This function shall not participate in overload resolution unlessThe expressionisfrom_stream(declval<basic_istream<charT, traits>&>(), fmt.c_str(), tp, addressof(abbrev))a valid expressionwell-formed when treated as an unevaluated operand. -5- Returns: A manipulator such that, when extracted from a basic_istream<charT, traits> is,the expression is >> parse(fmt, tp, abbrev) has type I, value is, and calls from_stream(is, fmt.c_str(), tp, addressof(abbrev)).template<class charT, class traits, class Alloc, class Parsable> unspecified parse(const basic_string<charT, traits, Alloc>& fmt, Parsable& tp, minutes& offset);-6-
RemarksConstraints:This function shall not participate in overload resolution unlessThe expressionisfrom_stream(declval<basic_istream<charT, traits>&>(), fmt.c_str(), tp, declval<basic_string<charT, traits, Alloc>*>()nullptr, &offset)a valid expressionwell-formed when treated as an unevaluated operand. -7- Returns: A manipulator such that, when extracted from a basic_istream<charT, traits> is,the expression is >> parse(fmt, tp, offset) has type I, value is, and calls from_stream(is, fmt.c_str(), tp, static_cast<basic_string<charT, traits, Alloc>*>(nullptr), &offset).template<class charT, class traits, class Alloc, class Parsable> unspecified parse(const basic_string<charT, traits, Alloc>& fmt, Parsable& tp, basic_string<charT, traits, Alloc>& abbrev, minutes& offset);-8-
RemarksConstraints:This function shall not participate in overload resolution unlessThe expressionisfrom_stream(declval<basic_istream<charT, traits>&>(), fmt.c_str(), tp, addressof(abbrev), &offset)a valid expressionwell-formed when treated as an unevaluated operand. -9- Returns: A manipulator such that, when extracted from a basic_istream<charT, traits> is,the expression is >> parse(fmt, tp, abbrev, offset) has type I, value is, and calls from_stream(is, fmt.c_str(), tp, addressof(abbrev), &offset).
None of the parse manipulators for the chrono types specifies the result of the extraction from the stream, as consequence they cannot be chained with the other read operations (at least portably). For example the following code is not required to work:
std::chrono::sys_stime s; int x; std::cin >> std::chrono::parse("%X", s) >> x;
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2020-02-24 16:02:59 | admin | set | status: immediate -> wp |
2020-02-14 11:00:18 | admin | set | messages: + msg11113 |
2020-02-14 11:00:18 | admin | set | status: new -> immediate |
2020-02-13 17:56:25 | admin | set | messages: + msg11072 |
2019-10-07 02:21:30 | admin | set | messages: + msg10676 |
2019-09-01 19:50:50 | admin | set | messages: + msg10594 |
2019-09-01 00:00:00 | admin | create |