Skip to content

Commit 249dc8f

Browse files
authored
Merge pull request #3885 from 0xFireWolf/master
[C++] Fix the compiler errors reported by GCC 7
2 parents aa1f1f1 + 9d7741d commit 249dc8f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

runtime/Cpp/runtime/src/FlatHashMap.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ namespace antlr4 {
4848
using FlatHashMap = absl::flat_hash_map<Key, Value, Hash, Equal, Allocator>;
4949
#else
5050
template <typename Key, typename Value,
51-
typename Hash = typename std::unordered_map<Key, Value>::hasher,
52-
typename Equal = typename std::unordered_map<Key, Value>::key_equal,
53-
typename Allocator = typename std::unordered_map<Key, Value>::allocator_type>
51+
typename Hash = std::hash<Key>,
52+
typename Equal = std::equal_to<Key>,
53+
typename Allocator = std::allocator<std::pair<const Key, Value>>>
5454
using FlatHashMap = std::unordered_map<Key, Value, Hash, Equal, Allocator>;
5555
#endif
5656

runtime/Cpp/runtime/src/FlatHashSet.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ namespace antlr4 {
4848
using FlatHashSet = absl::flat_hash_set<Key, Hash, Equal, Allocator>;
4949
#else
5050
template <typename Key,
51-
typename Hash = typename std::unordered_set<Key>::hasher,
52-
typename Equal = typename std::unordered_set<Key>::key_equal,
53-
typename Allocator = typename std::unordered_set<Key>::allocator_type>
51+
typename Hash = std::hash<Key>,
52+
typename Equal = std::equal_to<Key>,
53+
typename Allocator = std::allocator<Key>>
5454
using FlatHashSet = std::unordered_set<Key, Hash, Equal, Allocator>;
5555
#endif
5656

0 commit comments

Comments
 (0)