Skip to content

Commit

Permalink
Add MONGO_HASH_NAMESPACE macro for use in implementing std::hash<T>.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Schwerin committed Sep 9, 2013
1 parent 05c3839 commit f1e0901
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mongo/platform/hash_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#define MONGO_HASH_NAMESPACE_START namespace std {
#define MONGO_HASH_NAMESPACE_END }
#define MONGO_HASH_NAMESPACE std

#elif defined(_MSC_VER) && _MSC_VER >= 1500

Expand All @@ -33,13 +34,15 @@

#define MONGO_HASH_NAMESPACE_START namespace std {
#define MONGO_HASH_NAMESPACE_END }
#define MONGO_HASH_NAMESPACE std

#else /* Older Visual Studio */

#include <tr1/functional>

#define MONGO_HASH_NAMESPACE_START namespace std { namespace tr1 {
#define MONGO_HASH_NAMESPACE_END }}
#define MONGO_HASH_NAMESPACE std::tr1

#endif

Expand All @@ -49,6 +52,7 @@

#define MONGO_HASH_NAMESPACE_START namespace std { namespace tr1 {
#define MONGO_HASH_NAMESPACE_END }}
#define MONGO_HASH_NAMESPACE std::tr1

#else
#error "Cannot determine namespace for 'hash'"
Expand Down

0 comments on commit f1e0901

Please sign in to comment.