]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/hashcomp.h
Use the error name constants here now rather than magic numbers. magic numbers blow...
[user/henk/code/inspircd.git] / include / hashcomp.h
index 6a6022a210c12fee732b8f146af5d3ebfb8e645b..9499c00e49c17a1579351db8dc08fc33ba05b200 100644 (file)
@@ -14,6 +14,7 @@
 #ifndef _HASHCOMP_H_
 #define _HASHCOMP_H_
 
+#include <cstring>
 //#include "inspircd_config.h"
 //#include "socket.h"
 #include "hash_map.h"
@@ -620,6 +621,21 @@ inline bool operator!= (const std::string& leftval, const irc::string& rightval)
        return !(leftval.c_str() == rightval);
 }
 
+// FIXME MAXBUF messes up these
+#if 0
+template<std::size_t N>
+static inline bool operator == (std::string const &lhs, char const (&rhs)[N])
+{
+       return lhs.length() == N - 1 && !std::memcmp(lhs.data(), rhs, N - 1);
+}
+
+template<std::size_t N>
+static inline bool operator != (std::string const &lhs, char const (&rhs)[N])
+{
+       return !(lhs == rhs);
+}
+#endif
+
 /** Assign an irc::string to a std::string.
  */
 inline std::string assign(const irc::string &other) { return other.c_str(); }