Fix: patch bundled Boost hash.hpp for C++17 std::unary_function removal#2750
Open
Sahilll10 wants to merge 1 commit intosu2code:developfrom
Open
Fix: patch bundled Boost hash.hpp for C++17 std::unary_function removal#2750Sahilll10 wants to merge 1 commit intosu2code:developfrom
Sahilll10 wants to merge 1 commit intosu2code:developfrom
Conversation
In C++17, std::unary_function was removed. The bundled Boost headers in tecio (boost/container_hash/hash.hpp) use std::unary_function in hash_base under a guard (_HAS_AUTO_PTR_ETC) that only activates on MSVC. On MacOS clang and Linux GCC with C++17, the guard never triggers, causing a compilation error. Fix: replaced std::unary_function inheritance in the #else branch with explicit typedef declarations, identical to what the #if branch already does correctly. Fixes su2code#2583
3 tasks
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.
Root Cause
boost/container_hash/hash.hpphas a guard#if defined(_HAS_AUTO_PTR_ETC)which is MSVC-only. On MacOS/clang and GCC with C++17, this guard never
activates, so
hash_baseinherits fromstd::unary_functionwhich wasremoved in C++17, causing a build failure.
Fix
Patched the
#elsebranch ofhash_baseinexternals/tecio/boost.tar.gzto use explicit
typedefdeclarations instead ofstd::unary_functioninheritance. This matches what the
#ifbranch already does correctly forMSVC. No behaviour change.
Verification
Zero occurrences of
unary_functionremain inboost/container_hash/hash.hppafter repacking.Files Changed
externals/tecio/boost.tar.gz— one struct patched inboost/container_hash/hash.hppFixes #2583