diff options
author | Spencer T Brody <spencer@mongodb.com> | 2014-07-16 17:42:56 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2014-07-17 12:53:56 -0400 |
commit | f9a5d666e40d462cfd13fb31e590b0aa25db3133 (patch) | |
tree | ddedf8d155efda05b9e566322fa4659dcf5ced4c /src/mongo/bson/oid.cpp | |
parent | 782258785ff78679c18646bd86de7cb9cb780618 (diff) | |
download | mongo-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.cpp | 6 |
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; |