Closed jmarrec closed 1 year ago
BOOST_NO_CXX98_FUNCTION_BASE
doesn't work.
Updating to Boost 1.83, lots of deprecated errors due to filesystem.
Ok, either of these works:
add_definitions(-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0))
add_definitions(-DBOOST_NO_CXX98_FUNCTION_BASE)
add_definitions(-D_HAS_AUTO_PTR_ETC=0)
endif()
Issue overview
My M1 updated Xcode while I was working. Could compile fine, then 30 minutes later I couldn't anymore.
This is due to the removal of the
std::unary_function
from the stdlib. https://github.com/boostorg/container_hash/blob/355603c0c2a56013d7e44f3a0952004f4f280b39/include/boost/container_hash/hash.hpp#L132std::unary_function was deprecated in C++11 and removed in C++17, so this is just Apple Clang finally complying with the standard. https://en.cppreference.com/w/cpp/utility/functional/unary_function
This was fixed in boost 1.81 by this commit: https://github.com/boostorg/container_hash/commit/4e11c855cb4c7813c75ff5a34f3d9e4fe7d800a0
Current Behavior
Expected Behavior
Steps to Reproduce
Compile with Apple Clang 15
Possible Solution
BOOST_NO_CXX98_FUNCTION_BASE
.Details
Environment
Some additional details about your environment for this issue (if relevant):