瀏覽代碼

Fix hash_map type parameter to add Alloc for other platforms.

Change-Id: Idc5fb65a2cc469d55aff6f2cde0b51b326be0963
Jisi Liu 10 年之前
父節點
當前提交
14fe0c99bb
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      src/google/protobuf/stubs/hash.h

+ 6 - 4
src/google/protobuf/stubs/hash.h

@@ -89,8 +89,9 @@ struct hash<const char*> {
 
 template <typename Key, typename Data,
           typename HashFcn = hash<Key>,
-          typename EqualKey = int >
-class hash_map : public std::map<Key, Data, HashFcn> {
+          typename EqualKey = int,
+          typename Alloc = std::allocator< std::pair<const Key, Data> > >
+class hash_map : public std::map<Key, Data, HashFcn, Alloc> {
  public:
   hash_map(int = 0) {}
 };
@@ -125,9 +126,10 @@ struct hash<const char*>
 
 template <typename Key, typename Data,
           typename HashFcn = hash<Key>,
-          typename EqualKey = int >
+          typename EqualKey = int,
+          typename Alloc = std::allocator< std::pair<const Key, Data> > >
 class hash_map : public GOOGLE_PROTOBUF_HASH_NAMESPACE::hash_map<
-    Key, Data, HashFcn> {
+    Key, Data, HashFcn, Alloc> {
  public:
   hash_map(int = 0) {}
 };