-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: start building with C++20 Standard #2019
Conversation
Like it. Worth doing for the formatting changes in the PCG headers alone! |
This also upgrades TBB
This isn't strictly necessary, but makes the compilation and running stages distinct, so it's easier to diagnose issues.
Co-authored-by: Tristan Youngs <[email protected]>
@trisyoungs I've moved in the copyright updates into this PR. I'm just looking to fix up the windows build. Or should we make that a separate PR, now that we at least have the QC working again. |
@rprospero I think, if it turns out to be a quick / easy fix then wrap it in to this PR so we can get the whole CI rolling again. If it turns out to be more of an effort, split it. |
This PR starts compiling with the C++20 standard. This causes some knock-on effects
fmt
formatting libraryclang-format
from version 13 to version 17The most interesting files to look at are:
A couple of notes to take while looking through the pr
fmt::print
, so I replacedthose calls with
std::cout
std::format
requires that the format string is known atcompile time. This means that formats passed as a function or
switched via a ternary expression cannot be used. The
std::vformat
function handles dynamic formats, though itrequires an ugly wrapping of the parameters. For most of the
ternary cases, I simply moved the conditional outside of the
format call to regain the benefit of static format checking.
Allegedly, C++26 will merge
format
andvformat
.I'll pull this out of draft once it compiles on all platforms and passes all tests.