Skip to content

[Motions 2026 03 lwg 1] P4145R0 C++ Standard Library Ready Issues#8926

Open
burblebee wants to merge 44 commits intomainfrom
motions-2026-03-lwg-1
Open

[Motions 2026 03 lwg 1] P4145R0 C++ Standard Library Ready Issues#8926
burblebee wants to merge 44 commits intomainfrom
motions-2026-03-lwg-1

Conversation

@burblebee
Copy link
Copy Markdown
Contributor

@burblebee burblebee commented Apr 7, 2026

Fixes #8835.

Also fixes cplusplus/nbballot#708
Also fixes cplusplus/nbballot#814
Also fixes cplusplus/nbballot#879
Also fixes cplusplus/nbballot#855
Also fixes cplusplus/nbballot#830

Notes:

  • LWG4474: See FIXMEs for concerns about the wording.

@jensmaurer
Copy link
Copy Markdown
Member

I have added "fixes cplusplus/nbballot" links in the initial comment of this pull request. It would be good to amend the corresponding commits with our usual "Fixes NB ... (C++26 CD)." text (examples all over "git log").

@burblebee burblebee force-pushed the motions-2026-03-lwg-1 branch from c3db190 to 1ec13a4 Compare April 7, 2026 13:21
@burblebee burblebee marked this pull request as ready for review April 7, 2026 13:21
@burblebee burblebee marked this pull request as draft April 7, 2026 13:47
burblebee added 20 commits April 7, 2026 06:53
Fixes NB GB 05-129 (C++26 CD).
…only concept duplication

Fixes NB US 151-242 (C++26 CD).
…the difference type is also a sentinel type
…ng (data_handle_type, mapping_type, accessor_type) and the corresponding constructor
…() member functions of std::filesystem::path are misnamed

Fixes NB US 189-304 (C++26 CD).
[tab:time.format.spec],[tab:time.parse.spec] Fixed wording and formatting in examples
@burblebee burblebee force-pushed the motions-2026-03-lwg-1 branch from 1ec13a4 to 076fc37 Compare April 7, 2026 13:56
@burblebee burblebee marked this pull request as ready for review April 7, 2026 13:58
if the rounding style is to the nearest representable value;
%FIXME: The wording "equally near" seems problematic.
if there are two equally near such values,
%FIXME: Can multiple values have an "even least significant digit"? Or none at all?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there's at least one such value. Although when the radix of the floating-point type is odd (which is theoretically permitted but doesn't seem present in any implementation), there may be two.

Copy link
Copy Markdown
Member

@eisenwave eisenwave Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording is fine; I don't see any problem with the term "equally near". I could have phrased it as "equidistant" but that seemed too fancy.

An obvious example of where the "to even" part kicks in is when you divide the smallest possible float value by two. Zero and the subnormal minimum are equally near, and you disambiguate by choosing the number with the even least significant digit, which is zero. You get the same ambiguity halfway between all adjacent numbers with equal exponent at least.

The really interesting case is when even the "to even" disambiguation isn't sufficient 😄 I'm not sure about odd radix, but for even radix, this only occurs for floating-point types with a single digit mantissa digit. This case is deliberately left as a wording hole though in order to not mandate more than C's FLT_ROUNDS mandates. Implementers know what to do anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there can be more than 1 "equally near" values with "even least significant digit"s, then we can't chose "the one with an even least significant digit".

Copy link
Copy Markdown
Member

@eisenwave eisenwave Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay yeah that's true. I think you have to explicitly spell out the ambiguity instead of acting as if there was none for this not to be a wording defect. That belongs outside this PR and either in a follow-up editorial fix or LWG issue though, unless the fix is really obvious, which it isn't.

If you wanted to be explicit about the remaining ambiguity, you would either need to go full roundTiesToEven as per ISO/IEC 60559 and disambiguate according to that (stricter than C), or leave it implementation-defined (imposes documentation requirement), or unspecified (may be non-deterministic), and which one to choose isn't remotely obvious or editorial.

@jwakely
Copy link
Copy Markdown
Member

jwakely commented Apr 9, 2026

The fourth commit in the series (fd289eb) says "CWG" instead of "LWG" in the commit log.

of offset from \tcode{\%EC} (year only).
\begin{tailexample}
\begin{codeblock}
cout << format("{:%C %y}", -1976y); // prints \tcode{-20 76}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue didn't ask for a codeblock, so this is an editorial change.

the locale's alternative representation.
\begin{tailexample}
\begin{codeblock}
year y;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also an editorial change, the issue didn't ask for a codeblock.

\rSec4[mdspan.sub.canonical]{\tcode{submdspan} slice canonicalization}

\indexlibraryglobal{submdspan_canonicalize_slices}%
%FIXME: "Slices" is used instead of "SliceSpecifiers" in the synopsis declaration.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be filed as an editorial issue on github, rather than as a FIXME comment in the source.

Let $P$ be
\begin{itemize}
\item
the template parameter object\iref{temp.param}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was confused why the surrounding context didn't match what was in the issue, but it was changed by a091468

Copy link
Copy Markdown
Member

@jwakely jwakely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a few minor comments but everything looks correct. Nice work, Dawn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2026-03 LWG Motion 1] P4145R0 C++ Standard Library Ready Issues

5 participants