aboutsummaryrefslogtreecommitdiff
path: root/gcc/hash-map-traits.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/hash-map-traits.h')
-rw-r--r--gcc/hash-map-traits.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/gcc/hash-map-traits.h b/gcc/hash-map-traits.h
index 2225426..773ac1b 100644
--- a/gcc/hash-map-traits.h
+++ b/gcc/hash-map-traits.h
@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see
/* Implement hash_map traits for a key with hash traits H. Empty and
deleted map entries are represented as empty and deleted keys. */
-template <typename H>
+template <typename H, typename Value>
struct simple_hashmap_traits
{
typedef typename H::value_type key_type;
@@ -41,56 +41,58 @@ struct simple_hashmap_traits
template <typename T> static inline void mark_deleted (T &);
};
-template <typename H>
+template <typename H, typename Value>
inline hashval_t
-simple_hashmap_traits <H>::hash (const key_type &h)
+simple_hashmap_traits <H, Value>::hash (const key_type &h)
{
return H::hash (h);
}
-template <typename H>
+template <typename H, typename Value>
inline bool
-simple_hashmap_traits <H>::equal_keys (const key_type &k1, const key_type &k2)
+simple_hashmap_traits <H, Value>::equal_keys (const key_type &k1,
+ const key_type &k2)
{
return H::equal (k1, k2);
}
-template <typename H>
+template <typename H, typename Value>
template <typename T>
inline void
-simple_hashmap_traits <H>::remove (T &entry)
+simple_hashmap_traits <H, Value>::remove (T &entry)
{
H::remove (entry.m_key);
+ entry.m_value.~Value ();
}
-template <typename H>
+template <typename H, typename Value>
template <typename T>
inline bool
-simple_hashmap_traits <H>::is_empty (const T &entry)
+simple_hashmap_traits <H, Value>::is_empty (const T &entry)
{
return H::is_empty (entry.m_key);
}
-template <typename H>
+template <typename H, typename Value>
template <typename T>
inline bool
-simple_hashmap_traits <H>::is_deleted (const T &entry)
+simple_hashmap_traits <H, Value>::is_deleted (const T &entry)
{
return H::is_deleted (entry.m_key);
}
-template <typename H>
+template <typename H, typename Value>
template <typename T>
inline void
-simple_hashmap_traits <H>::mark_empty (T &entry)
+simple_hashmap_traits <H, Value>::mark_empty (T &entry)
{
H::mark_empty (entry.m_key);
}
-template <typename H>
+template <typename H, typename Value>
template <typename T>
inline void
-simple_hashmap_traits <H>::mark_deleted (T &entry)
+simple_hashmap_traits <H, Value>::mark_deleted (T &entry)
{
H::mark_deleted (entry.m_key);
}