Section: 30.13 [time.parse] Status: NAD Submitter: Howard Hinnant Opened: 2019-09-02 Last modified: 2020-09-06
Priority: 3
View other active issues in [time.parse].
View all other issues in [time.parse].
View all issues with NAD status.
Discussion:
from_stream
overloads may need to set various formatting state and flags of the basic_istream
to implement the parsing functionality. Such settings must not persist beyond the parsing functions. Thus
these functions need to save and restore any settings on the basic_istream
they may need to change.
[2019-10 Priority set to 3 after reflector discussion]
[2020-02, Prague; Close as NAD]
LWG reviewed the issue and decided no change is needed. Unless specified to change the flags, it's assumed that the stream flags are unchanged by any input function.Proposed resolution:
This wording is relative to N4830.
[Drafting note: The modification of 30.13 [time.parse] p1 is intended to be non-conflictingly mergeable with the change suggested by LWG 3269 at the same paragraph.]
Modify 30.13 [time.parse] as indicated:
-1- Each parse overload specified in this subclause calls
[…] -10- Allfrom_stream
unqualified, so as to enable argument dependent lookup (6.5.4 [basic.lookup.argdep]). In the following paragraphs, letis
denote an object of typebasic_istream<charT, traits>
, wherecharT
andtraits
are template parameters in that context.from_stream
overloads behave as unformatted input functions, except that they have an unspecified effect on the value returned by subsequent calls tobasic_istream<>::gcount()
. Any changes made tois.fill()
,is.width()
oris.flags()
are undone prior to an returning or exceptional execution ([thread.once.callonce]). Each overload takes a format string containing ordinary characters and flags which have special meaning. Each flag begins with a%
. Some flags can be modified byE
orO
. During parsing each flag interprets characters as parts of date and time types according to Table [tab:time.parse.spec]. Some flags can be modified by a width parameter given as a positive decimal integer called out asN
below which governs how many characters are parsed from the stream in interpreting the flag. All characters in the format string that are not represented in Table [tab:time.parse.spec], except for white space, are parsed unchanged from the stream. A white space character matches zero or more white space characters in the input stream.