From e1ace703fbf4458d9e887ebf30050b1a0482a2d2 Mon Sep 17 00:00:00 2001 From: Gil Date: Wed, 11 Jul 2018 15:27:50 -0700 Subject: 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 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 --- Firestore/core/src/firebase/firestore/util/hashing.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Firestore/core/src/firebase/firestore/util/hashing.h') 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{}(std::declval()))`. */ template -using std_hash_type = typename std::enable_if{}, size_t>::type; +using std_hash_type = + typename std::enable_if::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; } -- cgit v1.2.3