Add design spec for C++17 migration#96
Open
joshbainbridge wants to merge 1 commit intomainfrom
Open
Conversation
9f4aece to
06763e0
Compare
The project currently requires a binary/header-only install split due to C++14 lacking inline variables. This causes user-facing complexity with three extra CMake options and conditional compilation in bntables.h. Add a design document covering the migration plan from C++14 to C++17. This includes replacing constexpr/extern table patterns with inline constexpr, removing the OPENQMC_ENABLE_BINARY build machinery, updating documentation, and assessing NVCC compatibility risks. Assisted-by: Amp:claude-opus-4.6 Signed-off-by: Josh Bainbridge <josh.bainbridge@gmail.com>
06763e0 to
24d753f
Compare
joesfer
reviewed
Apr 28, 2026
| C++17 introduces `inline` variable declarations. An `inline constexpr` | ||
| namespace-scope variable has external linkage and is guaranteed to have a | ||
| single definition across all translation units. This directly solves the | ||
| duplication problem with no build system workaround required. |
There was a problem hiding this comment.
Worth noting that OPENQMC_ENABLE_BINARY was solving two problems at once: C++14's internal-linkage duplication in the final binary, and having each TU parse ~393K lines of integer literals. C++17 inline constexpr fixes the duplication but reintroduces the per-TU parse cost. The spec should measure this on a representative consumer and accept the trade-off explicitly.
Collaborator
Author
There was a problem hiding this comment.
This is great feedback. A really good point about the compiler time. I'll see if we can setup a test to verify the effect this change would have on this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The project currently requires a binary/header-only install split due to C++14 lacking inline variables. This causes user-facing complexity with three extra CMake options and conditional compilation in bntables.h. #86
Add a design document covering the migration plan from C++14 to C++17. This includes replacing constexpr/extern table patterns with inline constexpr, removing the OPENQMC_ENABLE_BINARY build machinery, and updating documentation.
For easier reading, you can enable the formatted display using this option on the Files changed tab:
