summaryrefslogtreecommitdiff
path: root/src/mongo/bson/oid.cpp
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2014-07-16 17:42:56 -0400
committerSpencer T Brody <spencer@mongodb.com>2014-07-17 12:53:56 -0400
commitf9a5d666e40d462cfd13fb31e590b0aa25db3133 (patch)
treeddedf8d155efda05b9e566322fa4659dcf5ced4c /src/mongo/bson/oid.cpp
parent782258785ff78679c18646bd86de7cb9cb780618 (diff)
downloadmongo-f9a5d666e40d462cfd13fb31e590b0aa25db3133.tar.gz
SERVER-14587 Add hash function to OID so it can be stored in an unordered_map
Diffstat (limited to 'src/mongo/bson/oid.cpp')
-rw-r--r--src/mongo/bson/oid.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/bson/oid.cpp b/src/mongo/bson/oid.cpp
index 92664fd753c..b073c8efa49 100644
--- a/src/mongo/bson/oid.cpp
+++ b/src/mongo/bson/oid.cpp
@@ -50,6 +50,12 @@ namespace mongo {
boost::hash_combine(seed, z);
}
+ size_t OID::Hasher::operator() (const OID& oid) const {
+ size_t seed = 0;
+ oid.hash_combine(seed);
+ return seed;
+ }
+
// machine # before folding in the process id
OID::MachineAndPid OID::ourMachine;