是否有可能在C++ 03中可移植地散列指针,该指针尚未std::hash定义?
std::hash
在C++中包含指针的hashables似乎很奇怪,但我想不出任何方法来制作它们.
我能想到的最接近的方式是做reinterpret_cast<uintptr_t>(ptr),但uintptr_t不需要在C++ 03中定义,我不确定这个值是否可以合法操纵,即使它被定义了......这是否可能?
reinterpret_cast<uintptr_t>(ptr)
uintptr_t
c++ hash pointers language-lawyer
c++ ×1
hash ×1
language-lawyer ×1
pointers ×1