Skip to content

Commit

Permalink
Use "our own name-based hash and equality functions" for `std::type_i…
Browse files Browse the repository at this point in the history
…ndex` only under macOS, based on results shown under pybind#4316 (comment)
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Nov 7, 2022
1 parent 9d70eba commit 9141519
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/detail/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ inline void tls_replace_value(PYBIND11_TLS_KEY_REF key, void *value) {
// libstdc++, this doesn't happen: equality and the type_index hash are based on the type name,
// which works. If not under a known-good stl, provide our own name-based hash and equality
// functions that use the type name.
#if defined(__GLIBCXX__)
#if !defined(__apple_build_version__)
inline bool same_type(const std::type_info &lhs, const std::type_info &rhs) { return lhs == rhs; }
using type_hash = std::hash<std::type_index>;
using type_equal_to = std::equal_to<std::type_index>;
Expand Down

0 comments on commit 9141519

Please sign in to comment.