Skip to content

Ranges ranges ranges#533

Merged
jwakely merged 17 commits intocplusplus:masterfrom
jwakely:ranges-ranges-ranges
Dec 12, 2025
Merged

Ranges ranges ranges#533
jwakely merged 17 commits intocplusplus:masterfrom
jwakely:ranges-ranges-ranges

Conversation

@jwakely
Copy link
Copy Markdown
Member

@jwakely jwakely commented Dec 11, 2025

A series of changes to make more use of modern C++20 features.

Several functions can be made more generic by using std::span instead of passing references to std::vector.

Some loops are changed to loop over a span and remove the prefix that has been processed.

Using projections with ranges algos simplifies several places.

@jwakely jwakely force-pushed the ranges-ranges-ranges branch from a8ccbd2 to 569de89 Compare December 12, 2025 13:20
@jwakely
Copy link
Copy Markdown
Member Author

jwakely commented Dec 12, 2025

No changes to the generated HTML except as noted in one commit:

Add report_generator::make_sort_by_status_impl helper

Common impl for make_sort_by_status and make_sort_by_status_mod_date.

This changes the generated HTML slightly, because it means that the
lwg-status.html, unresolved-status.html, and voting-status.html pages
now have OpenGraph metadata:

--- mailing.orig/lwg-status.html        2025-12-10 23:22:08.142390521 +0000
+++ mailing.good/lwg-status.html        2025-12-11 11:57:02.753796799 +0000
@@ -3,6 +3,12 @@
 <head>
 <meta charset="utf-8">
 <title>LWG Index by Status and Section</title>
+<meta property="og:title" content="LWG Index by Status and Section">
+<meta property="og:description" content="C++ standard library issues list">
+<meta property="og:url" content="https://cplusplus.github.io/LWG/lwg-status.html">
+<meta property="og:type" content="website">
+<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
+<meta property="og:image:alt" content="C++ logo">
 <style>
   p {text-align:justify}
   li {text-align:justify}

This seems like a good change. It makes those pages consistent with the
equivalent *-status-date.html pages.

The *-status-date.html pages get an extra blank line in the HTML as
well, because all those *-status*.html pages are generated by the same
function now.

@jwakely jwakely force-pushed the ranges-ranges-ranges branch from 569de89 to 3653804 Compare December 12, 2025 13:29
Comment thread src/list_issues.cpp Outdated
Comment thread src/report_generator.cpp Outdated
out << "<p>" << build_timestamp << "</p>";

for (auto i = issues.cbegin(), e = issues.cend(); i != e;) {
for (auto i = issues.begin(), e = issues.end(); i != e;) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe use chunk_by(issues, [](const issue& lhs, const& issue rhs) { return lhs.stat != rhs.stat; }); if we can depend on that.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The code is compiled with -std=c++20 currently. We could change that, if everybody working with the issues has a compiler that can handle C++23.

Comment thread src/toc_diff.cpp Outdated
Comment thread src/report_generator.cpp
out << "<h2 id=\"" << idattr << "\">" << current_status << " (" << (j-i) << " issues)</h2>\n";
print_table(out, {i, j}, section_db);
i = j;
while (!issues.empty())
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This also seem like chunk_by.

Copy link
Copy Markdown

@tomaszkam tomaszkam left a comment

Choose a reason for hiding this comment

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

LGTM. I have noted a few places where you could improve by using chunk_by.

Also replace some loops with range-based for.
Common impl for make_sort_by_status and make_sort_by_status_mod_date.

This changes the generated HTML slightly, because it means that the
lwg-status.html, unresolved-status.html, and voting-status.html pages
now have OpenGraph metadata:

--- mailing.orig/lwg-status.html        2025-12-10 23:22:08.142390521 +0000
+++ mailing.good/lwg-status.html        2025-12-11 11:57:02.753796799 +0000
@@ -3,6 +3,12 @@
 <head>
 <meta charset="utf-8">
 <title>LWG Index by Status and Section</title>
+<meta property="og:title" content="LWG Index by Status and Section">
+<meta property="og:description" content="C++ standard library issues list">
+<meta property="og:url" content="https://cplusplus.github.io/LWG/lwg-status.html">
+<meta property="og:type" content="website">
+<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
+<meta property="og:image:alt" content="C++ logo">
 <style>
   p {text-align:justify}
   li {text-align:justify}

This seems like a good change. It makes those pages consistent with the
equivalent *-status-date.html pages.

The *-status-date.html pages get an extra blank line in the HTML as
well, because all those *-status*.html pages are generated by the same
function now.
…jections

Ranges algos can just use a pointer-to-member projection instead.
Also remove outdated comment and alternative code that is no simpler.
@jwakely jwakely force-pushed the ranges-ranges-ranges branch from 3653804 to 6ccf1d9 Compare December 12, 2025 18:45
@jwakely jwakely merged commit 7d7b466 into cplusplus:master Dec 12, 2025
2 checks passed
@jwakely jwakely deleted the ranges-ranges-ranges branch December 12, 2025 18:48
jwakely added a commit to jwakely/LWG that referenced this pull request Dec 12, 2025
As suggested by Tomasz in cplusplus#533

Use a helper function for C++20.
jwakely added a commit to jwakely/LWG that referenced this pull request Dec 12, 2025
As suggested by Tomasz in cplusplus#533

Use a helper function for C++20.
jwakely added a commit to jwakely/LWG that referenced this pull request Dec 12, 2025
As suggested by Tomasz in cplusplus#533

Use a helper function for C++20.
jwakely added a commit to jwakely/LWG that referenced this pull request Dec 12, 2025
As suggested by Tomasz in cplusplus#533

Use a helper function for C++20.
jwakely added a commit to jwakely/LWG that referenced this pull request Dec 12, 2025
As suggested by Tomasz in cplusplus#533

Use a helper function for C++20.
jwakely added a commit that referenced this pull request Dec 13, 2025
As suggested by Tomasz in #533

Use a helper function for C++20.
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.

2 participants