[2026-06 LWG Motion 6] P3395R6 (Fix encoding issues and add a formatter for std::error_code)#9129
[2026-06 LWG Motion 6] P3395R6 (Fix encoding issues and add a formatter for std::error_code)#9129notdanhan wants to merge 6 commits into
Conversation
510ad55 to
4405b34
Compare
eisenwave
left a comment
There was a problem hiding this comment.
Needs a fair amount of work, mainly converting to \grammarterm.
eisenwave
left a comment
There was a problem hiding this comment.
Some things are clearly wrong, but I could use some advice from @jensmaurer on the multi-paragraph \effects thing.
|
|
||
| \pnum | ||
| Otherwise, let \tcode{msg} be \tcode{std::format("{}:{}", ec.category().name(), ec.value())}. | ||
|
|
||
| \pnum | ||
| If the \tcode{?} option is used then \tcode{msg} is formatted as an escaped string(\iref{format.string.escaped}). | ||
| Writes \tcode{msg} into \tcode{ctx.out()}, adjusted according to the \fmtgrammarterm{error-code-format-spec}. |
There was a problem hiding this comment.
This all seems to be a scription of Effects to me, not separate paragraphs, but maybe I'm missing something. The paper does put gaps here, but idk, this is weird.
| \pnum | |
| Otherwise, let \tcode{msg} be \tcode{std::format("{}:{}", ec.category().name(), ec.value())}. | |
| \pnum | |
| If the \tcode{?} option is used then \tcode{msg} is formatted as an escaped string(\iref{format.string.escaped}). | |
| Writes \tcode{msg} into \tcode{ctx.out()}, adjusted according to the \fmtgrammarterm{error-code-format-spec}. | |
| Otherwise, let \tcode{msg} be \tcode{std::format("{}:{}", ec.category().name(), ec.value())}. | |
| If the \tcode{?} option is used then \tcode{msg} is formatted as an escaped string(\iref{format.string.escaped}). | |
| Writes \tcode{msg} into \tcode{ctx.out()}, adjusted according to the \fmtgrammarterm{error-code-format-spec}. |
There was a problem hiding this comment.
I think we do have multi-paragraph \effects in some places, but having a separate numbered paragraph for every sentence is certainly non-optimal.
There was a problem hiding this comment.
I don't love the use of a list with no other text before or after the list. If we went this form I think the final sentence should be its own bullet. "Writes msg into ctx.out()" applies to all cases, not only when ? is used.
We could just make it all one paragraph with no paragraph breaks, but keep the innermost list for the sub-clauses of the "If the s options is used" case. So exactly as in the incoming paper, except without a paragraph break before "If the ? option is used".
|
Do we want a feature-test macro for |
Barry pinged me about this last week, suggesting that user code could polyfill Is that useful though? If you have to write the fallback version, just use the fallback version. We do have |
|
I'm in favor of a new feature-test macro. Bumping a single macro gets really annoying when multiple features are "in flight"; it's more reasonable for a once-per-Standard thing. |

Fixes: #9093
Also Fixes cplusplus/papers#2187