Upgrade required language level to C++17 #4000
Open
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.
Related, the C++14 upgrade in Oct 2024: #3931
This PR upgrades the required language level from C++14 to C++17. The motivation for this is because I would like to implement caching mesh data between copies of
OpenSim::Mesh
, but doing so robustly requires filesystem queries likestd::filesystem::last_write_time
to handle edge-cases like "the file path didn't change but the timestamp did, so reload".In terms of compatibility, C++17 is generally available in Ubuntu18+, and even (e.g.) Ubuntu16 with a backported
libstdc++
. MacOS (Apple Clang) and Windows (MSVC) have had very good feature coverage for C++17 for around 5 or 6 years (save a few library functions in Apple Clang's case). OpenSim Creator has been compiling for C++20 for the last year, but the required OS-level is higher (Ubuntu20/Mac Sonoma/Windows 10).Additional benefits are the inclusion of
std::optional<T>
andstd::string_view
, which I imagine will slip into the codebase over time. This PR only addresses setting the flags, so that future PRs don't have to handle two things at one (e.g. "here's my new mesh caching routine, oh, also we need C++17").Brief summary of changes
Testing I've completed
Looking for feedback on...
CHANGELOG.md (choose one)
This change is