aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/stubs/hash.h
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2015-05-25 18:18:29 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2015-05-25 18:18:29 -0700
commit72f17c43675762b8ef46d73f953204de61ef0fed (patch)
tree24be89e0635e89a923fbcfe16b0d5343f6654ede /src/google/protobuf/stubs/hash.h
parent990728685584699f1eea2fa6b871d2312bd80829 (diff)
Make hash_map forward constructor parameters to its base class.
We use a custom allocator for map fields and this allocator must be passed correctly to hash_map to make sure it's allocated properly with our custom allocator. Change-Id: Ie59fa24bf11ff28ffd0fa870e24e456c66b2b9c5
Diffstat (limited to 'src/google/protobuf/stubs/hash.h')
-rwxr-xr-xsrc/google/protobuf/stubs/hash.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/google/protobuf/stubs/hash.h b/src/google/protobuf/stubs/hash.h
index 2d69fdc1..ee3c63fe 100755
--- a/src/google/protobuf/stubs/hash.h
+++ b/src/google/protobuf/stubs/hash.h
@@ -93,9 +93,12 @@ template <typename Key, typename Data,
typename EqualKey = std::equal_to<Key>,
typename Alloc = std::allocator< std::pair<const Key, Data> > >
class hash_map : public std::map<Key, Data, HashFcn, EqualKey, Alloc> {
+ typedef std::map<Key, Data, HashFcn, EqualKey, Alloc> BaseClass;
+
public:
- hash_map(int = 0, const HashFcn& = HashFcn(), const EqualKey& = EqualKey(),
- const Alloc& = Alloc()) {}
+ hash_map(int a = 0, const HashFcn& b = HashFcn(),
+ const EqualKey& c = EqualKey(),
+ const Alloc& d = Alloc()) : BaseClass(a, b, c, d) {}
};
template <typename Key,
@@ -133,9 +136,13 @@ template <typename Key, typename Data,
class hash_map
: public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<
Key, Data, HashFcn, EqualKey, Alloc> {
+ typedef GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<
+ Key, Data, HashFcn, EqualKey, Alloc> BaseClass;
+
public:
- hash_map(int = 0, const HashFcn& = HashFcn(), const EqualKey& = EqualKey(),
- const Alloc& = Alloc()) {}
+ hash_map(int a = 0, const HashFcn& b = HashFcn(),
+ const EqualKey& c = EqualKey(),
+ const Alloc& d = Alloc()) : BaseClass(a, b, c, d) {}
};
template <typename Key, typename HashFcn = hash<Key>,
@@ -187,9 +194,13 @@ template <typename Key, typename Data,
class hash_map
: public GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<
Key, Data, HashFcn, EqualKey, Alloc> {
+ typedef GOOGLE_PROTOBUF_HASH_NAMESPACE::GOOGLE_PROTOBUF_HASH_MAP_CLASS<
+ Key, Data, HashFcn, EqualKey, Alloc> BaseClass;
+
public:
- hash_map(int = 0, const HashFcn& = HashFcn(), const EqualKey& = EqualKey(),
- const Alloc& = Alloc()) {}
+ hash_map(int a = 0, const HashFcn& b = HashFcn(),
+ const EqualKey& c = EqualKey(),
+ const Alloc& d = Alloc()) : BaseClass(a, b, c, d) {}
};
template <typename Key, typename HashFcn = hash<Key>,