Skip to content

C++20 updates - #25

Merged
jeandet merged 5 commits into
LaboratoryOfPlasmaPhysics:masterfrom
PhilipDeegan:C++20
Oct 22, 2026
Merged

jeandet merged 5 commits into
LaboratoryOfPlasmaPhysics:masterfrom
PhilipDeegan:C++20

Conversation

@PhilipDeegan

Copy link
Copy Markdown
Member

No description provided.

@PhilipDeegan

Copy link
Copy Markdown
Member Author

closes #24

@PhilipDeegan
PhilipDeegan requested a review from jeandet October 21, 2026 20:06

@jeandet jeandet left a comment

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.

Thanks, nice cleanup. I built it locally with GCC 16 and Clang 22, and all tests pass.

The coverage job fails, though. It now builds with CXX=clang++, but lcov reads the coverage data with GCC's gcov, which rejects Clang's format (Incompatible GCC/GCOV version found). Since Clang already has its own CI job, could we drop CXX=clang++ there? If you want Clang for coverage, lcov --gcov-tool pointing at llvm-cov gcov should also work.

Comment thread include/dict.hpp Outdated
using Ts::operator()...;
};
template<typename... Ts>
Visitor(Ts...) -> Visitor<Ts...>;

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 think this guide is unused, since make_visitor below spells out Visitor<Ts...>. Can we drop it?

Also minor, on make_visitor: Visitor<Ts...>(lambdas...) builds an aggregate with parentheses, which only works from Clang 16. Clang 10–15 handle the concepts fine but fail on that line. Using braces (Visitor<Ts...>{lambdas...}) avoids that, unless we're fine with Clang 16 as the minimum.

Comment thread include/dict.hpp Outdated
}
} // namespace
template<typename T1, typename... T2>
concept any_of = (std::same_as<T1, T2> || ...);

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.

Nit: this used to be in an anonymous namespace and is now public as cppdict::any_of. If a user has both using namespace std; and using namespace cppdict;, an unqualified any_of(...) call becomes ambiguous with std::any_of. Maybe move it into detail?

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.

sure

@PhilipDeegan

PhilipDeegan commented Oct 21, 2026 •

Copy link
Copy Markdown
Member Author

the coverage build has been failing for a while so I'm not sure it was introduced here

I can try drop clang tho, not sure it's necessary

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.10%. Comparing base (9a4dd20) to head (88fe880).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
- Coverage   96.47%   92.10%   -4.38%     
==========================================
  Files           3        1       -2     
  Lines         284      114     -170     
==========================================
- Hits          274      105     -169     
+ Misses         10        9       -1     
Flag Coverage Δ
unittests 92.10% <100.00%> (-4.38%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeandet
jeandet merged commit 48dae68 into LaboratoryOfPlasmaPhysics:master Oct 22, 2026
4 of 5 checks passed
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