Fix WaitFreeHashMap::get_pointer.
This commit is contained in:
parent
ecfd1dacd3
commit
9e4ae8997b
@ -76,8 +76,8 @@ class WaitFreeHashMap {
|
||||
}
|
||||
|
||||
// specialization for WaitFreeHashMap<..., unique_ptr<T>>
|
||||
template <typename ReturnT = decltype(ValueT().get())>
|
||||
ReturnT get_pointer(const KeyT &key) {
|
||||
template <class T = ValueT>
|
||||
typename T::element_type *get_pointer(const KeyT &key) {
|
||||
auto &storage = get_storage(key);
|
||||
auto it = storage.find(key);
|
||||
if (it == storage.end()) {
|
||||
@ -86,8 +86,8 @@ class WaitFreeHashMap {
|
||||
return it->second.get();
|
||||
}
|
||||
|
||||
template <typename ReturnT = decltype(static_cast<const ValueT &>(ValueT()).get())>
|
||||
ReturnT get_pointer(const KeyT &key) const {
|
||||
template <class T = ValueT>
|
||||
const typename T::element_type *get_pointer(const KeyT &key) const {
|
||||
auto &storage = get_storage(key);
|
||||
auto it = storage.find(key);
|
||||
if (it == storage.end()) {
|
||||
|
@ -38,7 +38,7 @@ TEST(WaitFreeHashMap, stress_test) {
|
||||
result -= key * 101;
|
||||
result -= value;
|
||||
});
|
||||
ASSERT_EQ(0, result);
|
||||
ASSERT_EQ(0u, result);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user