aboutsummaryrefslogtreecommitdiff
path: root/gdbsupport/ptid.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-09-11 08:45:37 -0600
committerTom Tromey <tromey@adacore.com>2023-09-11 11:40:40 -0600
commit9a343d2bb57c4555dedad9b43907aeeda7b51dae (patch)
tree3a230b77933274b6513b0a5d576565e36e6e7318 /gdbsupport/ptid.h
parent14432bde076fdee66e6163993eadf592742935da (diff)
downloadbinutils-9a343d2bb57c4555dedad9b43907aeeda7b51dae.zip
binutils-9a343d2bb57c4555dedad9b43907aeeda7b51dae.tar.gz
binutils-9a343d2bb57c4555dedad9b43907aeeda7b51dae.tar.bz2
Specialize std::hash for ptid_t
This changes hash_ptid to instead be a specialization of std::hash. This makes it a little easier to use with standard containers. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdbsupport/ptid.h')
-rw-r--r--gdbsupport/ptid.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdbsupport/ptid.h b/gdbsupport/ptid.h
index aa296b8..f8644d4 100644
--- a/gdbsupport/ptid.h
+++ b/gdbsupport/ptid.h
@@ -157,9 +157,8 @@ private:
tid_type m_tid;
};
-/* Functor to hash a ptid. */
-
-struct hash_ptid
+template<>
+struct std::hash<ptid_t>
{
size_t operator() (const ptid_t &ptid) const
{