Created on 2020-06-30.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4885.
Modify [formatter.requirements], Table [tab:formatter], as indicated:
Table 67: Formatter requirements [tab:formatter] Expression Return type Requirement … f.format(t, fc) FC::iterator Formats t according to the specifiers stored in *this, writes the output to fc.out() and returns an iterator past the end of the output range. The output shall only depend on t, fc.locale(), fc.arg(n) for any value n of type size_t, and the range [pc.begin(), pc.end()) from the last call to f.parse(pc). …
[ 2021-06-07 Approved at June 2021 virtual plenary. Status changed: Voting → WP. ]
[ 2021-05-24; Reflector poll ]
Set status to Tentatively Ready after six votes in favour during reflector poll.
[ 2021-05-20 Tim comments and updates wording ]
During reflector discussion Victor said that the formatter requirements should allow dependency on any of the format arguments in the context. The wording below reflects that.
[ 2020-07-12; Reflector prioritization ]
Set priority to 3 after reflector discussions.
Previous resolution [SUPERSEDED]:
This wording is relative to N4861.
Modify [formatter.requirements], Table [tab:formatter], as indicated:
Table 67: Formatter requirements [tab:formatter] Expression Return type Requirement … f.format(t, fc) FC::iterator Formats t according to the specifiers stored in *this, writes the output to fc.out() and returns an iterator past the end of the output range. The output shall only depend on t, fc.locale(), andthe range [pc.begin(), pc.end()) from the last call to f.parse(pc), and fc.arg(n), where n is a size_t index value that has been validated with a call to pc.check_arg_id(n) in the last call to f.parse(pc).…
The requirements on the expression f.format(t, fc) in [tab:formatter] say
Formats t according to the specifiers stored in *this, writes the output to fc.out() and returns an iterator past the end of the output range. The output shall only depend on t, fc.locale(), and the range [pc.begin(), pc.end()) from the last call to f.parse(pc).
Strictly speaking, this wording effectively forbids f.format(t, fc) from calling fc.arg(n), whose motivation is precisely to allow a formatter to rely on arguments different from t. According to this interpretation, there's no conforming way to implement the "{ arg-id }" form of the width and precision fields of standard format specifiers. Moreover, the formatter described in the example if paragraph [format.context]/8 would also be non-conforming.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2021-06-07 16:58:04 | admin | set | messages: + msg11886 |
2021-06-07 16:58:04 | admin | set | status: voting -> wp |
2021-05-26 21:11:22 | admin | set | status: ready -> voting |
2021-05-24 21:00:14 | admin | set | messages: + msg11851 |
2021-05-24 21:00:14 | admin | set | status: new -> ready |
2021-05-21 01:44:16 | admin | set | messages: + msg11833 |
2020-07-12 16:33:28 | admin | set | messages: + msg11363 |
2020-07-05 17:03:02 | admin | set | messages: + msg11361 |
2020-06-30 00:00:00 | admin | create |