GlobalSingleton icon indicating copy to clipboard operation
GlobalSingleton copied to clipboard

typeid(T).hash_code在某些编译器、不同类型或不同版本编译器上有潜在风险

Open KondeU opened this issue 3 years ago • 0 comments

typeid(T).hash_code在Android的部分编译器上同一个类型在不同的so中的hash_code会不同,会导致GlobalSingleton无法工作;

若最终的dll/so集合混用了不同类型、不同版本的编译器,可能会有hash_code不一致的潜在风险。

https://github.com/KondeU/GlobalSingleton/blob/9b834b8b2c0b52e3374e0da79fc8b6a98ee3a8ea/Common/GlobalSingletonContext.hpp#L29

https://github.com/KondeU/GlobalSingleton/blob/9b834b8b2c0b52e3374e0da79fc8b6a98ee3a8ea/Common/GlobalSingletonContext.hpp#L43

https://github.com/KondeU/GlobalSingleton/blob/9b834b8b2c0b52e3374e0da79fc8b6a98ee3a8ea/Common/GlobalSingletonContext.hpp#L45

KondeU avatar Nov 26 '22 14:11 KondeU