diff options
author | Gil <mcg@google.com> | 2018-07-11 15:27:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-11 15:27:50 -0700 |
commit | e1ace703fbf4458d9e887ebf30050b1a0482a2d2 (patch) | |
tree | 63537e388b8d16a5625eedce0937cb50bf69d4c7 /Firestore/core/src/firebase/firestore/util/hashing.h | |
parent | 79f663d5eaaa4b7f9fe46d176c82660d38e4be8a (diff) |
Fix Firestore source errors under VS2017 (#1515)
* Project file updates from sync_project.rb
* Fix misc compile errors under VS2017
* Fix util/hashing under VS2017
std::hash<int> is not just a pass through in Microsoft's STL.
* Disable unsafe code warnings in VS2017
... where comparing against a reference implementation that has no easy
safe equivalent.
* Handle drive letters in paths on Windows
Diffstat (limited to 'Firestore/core/src/firebase/firestore/util/hashing.h')
-rw-r--r-- | Firestore/core/src/firebase/firestore/util/hashing.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Firestore/core/src/firebase/firestore/util/hashing.h b/Firestore/core/src/firebase/firestore/util/hashing.h index 21c0bd6..5219d64 100644 --- a/Firestore/core/src/firebase/firestore/util/hashing.h +++ b/Firestore/core/src/firebase/firestore/util/hashing.h @@ -82,7 +82,8 @@ struct has_std_hash { * `decltype(std::hash<T>{}(std::declval<T>()))`. */ template <typename T> -using std_hash_type = typename std::enable_if<has_std_hash<T>{}, size_t>::type; +using std_hash_type = + typename std::enable_if<has_std_hash<T>::value, size_t>::type; /** * Combines a hash_value with whatever accumulated state there is so far. @@ -151,9 +152,11 @@ auto RankedInvokeHash(const Range& range, HashChoice<2>) size_t size = 0; for (auto&& element : range) { ++size; - result = Combine(result, InvokeHash(element)); + size_t piece = InvokeHash(element); + result = Combine(result, piece); } - result = Combine(result, size); + size_t size_hash = InvokeHash(size); + result = Combine(result, size_hash); return result; } |