Chromium Code Reviews| Index: src/IceGlobalContext.cpp |
| diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp |
| index 6badc559aa9236b017ad9ad262d216812c0e25d4..76f9211ae22ae82378d35c3c7e97cb46d21e6a8b 100644 |
| --- a/src/IceGlobalContext.cpp |
| +++ b/src/IceGlobalContext.cpp |
| @@ -65,7 +65,15 @@ public: |
| } |
| private: |
| - typedef std::unordered_map<KeyType, ValueType *> ContainerType; |
| + struct compare { |
| + bool operator()(const KeyType &Value1, const KeyType &Value2) const { |
| + if (std::is_floating_point<KeyType>::value) |
| + return !memcmp(&Value1, &Value2, sizeof(KeyType)); |
| + return std::equal_to<KeyType>()(Value1, Value2); |
| + } |
| + }; |
| + typedef std::unordered_map<KeyType, ValueType *, std::hash<KeyType>, compare> |
| + ContainerType; |
|
JF
2015/03/19 16:33:09
template<typename T>
struct Compare {
typename s
Jim Stichnoth
2015/03/19 18:07:04
Cool. I did it a slightly different way.
It has
Jim Stichnoth
2015/03/19 19:57:49
Tweaked once more to combine integral types and Re
|
| ContainerType Pool; |
| uint32_t NextPoolID; |
| }; |