summaryrefslogtreecommitdiff
path: root/include/anope.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-07-29 18:38:56 -0400
committerAdam <Adam@anope.org>2010-07-29 18:38:56 -0400
commitcc649031792af1e94c7701decd708aba4091d708 (patch)
treeee936f487cbae10f782bd81a50c058f5d2c36c83 /include/anope.h
parent04200cc8382519c8ea18d214002bc0f063be7d3c (diff)
Rewrote the hashing systems to properly handle the new Anope::strings which we have everywhere.
Diffstat (limited to 'include/anope.h')
-rw-r--r--include/anope.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/anope.h b/include/anope.h
index 003927378..3749005ed 100644
--- a/include/anope.h
+++ b/include/anope.h
@@ -255,6 +255,17 @@ namespace Anope
friend std::ostream &operator<<(std::ostream &os, const string &_str);
};
+ /** Hash an Anope::string for unorderd_map, passed as the third template arg to unordered_map
+ */
+ struct hash
+ {
+ /** Hash an Anope::string for unordered_map
+ * @param s The string
+ * @return A hash value for the string
+ */
+ bool operator()(const string &s) const;
+ };
+
inline std::ostream &operator<<(std::ostream &os, const string &_str) { return os << _str._string; }
inline const string operator+(char chr, const string &str) { string tmp(chr); tmp += str; return tmp; }