3962. What is the "decimal precision of the input"?

Section: 29.13 [time.parse] Status: New Submitter: Jonathan Wakely Opened: 2023-07-28 Last modified: 2023-11-03 18:04:50 UTC

Priority: 3

View other active issues in [time.parse].

View all other issues in [time.parse].

View all issues with New status.


The %j flag talks about "the type being parsed" and %S talks about "the input time" and "the input", but doesn't really define which types those are.

[2023-11-02; Reflector poll]

Set priority to 3 after reflector poll.

Proposed resolution:

This wording is relative to N4950.

  1. Modify 29.13 [time.parse] as indicated:

    -?- In Table 102 the type Parsable denotes the type of the second argument to from_stream.

    %j If the type being parsed Parsable is a specialization of duration, a decimal number of days.
    %S The seconds as a decimal number. The modified command %NS specifies the maximum number of characters to read. If N is not specified, the default is 2 if Parsable is a calendrical type (29.8 [time.cal]) if the input time has a precision convertible to seconds. Otherwise the default width is determined by the decimal precision of the input Parsable, determined in the same manner as hh_mm_ss::fractional_width (29.9 [time.hms]). If the number of fractional decimal digits for the type is zero, then the default for N is 2. Otherwise, it is 3 + W, where W is the number of fractional decimal digits. If N is less than 3, the field is interpreted as a decimal integer, otherwise and the field is interpreted as a long double in a fixed format. If encountered, the locale determines the decimal point character. Leading zeroes are permitted but not required. The modified command %OS interprets the locale's alternative representation.