The issue was that redeclaring the hash template in the code somehow seems to shadow the declaration that is done in <functional> and <memory> and afterwards the template specialization of the hash function seems to use our redefined template instead of libc++’s one (most likely due to the fact that libc++ uses an inline namespace inside std)