CatchmentCsvOutputManager: Avoid hash<std::filessytem::path> compatibility pitfall - #1015
Open
PhilMiller wants to merge 1 commit into
Open
CatchmentCsvOutputManager: Avoid hash<std::filessytem::path> compatibility pitfall#1015PhilMiller wants to merge 1 commit into
PhilMiller wants to merge 1 commit into
Conversation
…ility pitfall Switch use of an unordered_map<std::filesystem::path, stream*> to map<path, stream*> to avoid the need for a hash function for std::filesystem::path. This is an issue because C++17 inadvertently omitted that requirement, and compilers' standard libraries conforming to C++17 didn't implement it until several versions later. For instance, GCC 9 supports full C++17, but the hash isn't implemented until 11.4.0, and is missing even in 11.2.0. Cf: https://cplusplus.github.io/LWG/issue3657 And the very last table row here: https://en.cppreference.com/cpp/compiler_support/17
Contributor
Author
|
I may also simplify out the corresponding bits in the Docker file and the dependencies documentation. |
Contributor
Author
|
Ahmad ran into this on the NSF Anvil cluster, which provides the not-good-enough GCC 11.2.0. |
Contributor
We should update these to drop the note about the hash limitation since it is no longer a blocker. GCC 9 still becomes the minimum for the std::filesystem implementation, and I don't see any real performance considerations that are going to matter for the typical use of 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.
Switch use of an unordered_map<std::filesystem::path, stream*> to map<path, stream*> to avoid the need for a hash function for std::filesystem::path. This is an issue because C++17 inadvertently omitted that requirement, and compilers' standard libraries conforming to C++17 didn't implement it until several versions later. For instance, GCC 9 supports full C++17, but the hash isn't implemented until 11.4.0, and is missing even in 11.2.0.
Cf:
https://cplusplus.github.io/LWG/issue3657
And the very last table row here:
https://en.cppreference.com/cpp/compiler_support/17
Testing
Notes
Checklist