If a patch were submitted using C++20 features from the <bit> header... #5
Replies: 3 comments
-
|
Thank you for this suggestion. You’re absolutely right—the C++20 library is exactly what this project needs to achieve cleaner, more portable code. The main reason we haven’t switched over yet is backward compatibility. We still support several large projects, such as SLiM, which are limited to C++11. Currently, pcg-cpp is focused on maintaining 100% compatibility with the original library and older environments. However, we’re not ignoring these modern improvements: The pcg-next branch: A member of our team, akurichan, has forked off into the pcg-next branch. Modern features: This is where we are actively implementing “cutting-edge” improvements, including C++20 features, without being constrained by legacy requirements. We highly encourage you to check out the pcg-next branch if you’re interested in experiencing these modern standards in practice! Translated with DeepL.com (free version) |
Beta Was this translation helpful? Give feedback.
-
|
Essentially, we have divided the project into two branches: pcg-cpp (maintaining compatibility) and pcg-next (progressive development). |
Beta Was this translation helpful? Give feedback.
-
|
Thanks to both JkarVN and akikurichan for giving good explanations of the current state of the project and some of its possible future directions! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
... would it be seriously considered?
I ask because clearly this project went to some effort to update the "bit" support routines, but did not make use of any of the great features of C++20 that support those operations in a clean and portable way?
For instance, std::bit_width, and the full complement of functions counting both leading and trailing zeroes and ones? Any of the modern compilers that implement C++20 will do their best to emit the appropriate single instructions that implement these - and without all the testing for this or that compiler or platform!
Obviously, it is still advisable to "guard" these calls with the standard-defined tests for "feature testing", as in
#if __cplusplus >= 202002L
... just curious.
Beta Was this translation helpful? Give feedback.
All reactions