X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fhashcomp.h;h=9499c00e49c17a1579351db8dc08fc33ba05b200;hb=b708dff6d2897271321764117582a47699e72876;hp=6a6022a210c12fee732b8f146af5d3ebfb8e645b;hpb=8a51d8969cd1b3800d15af8cf8dc6e15284da7aa;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/hashcomp.h b/include/hashcomp.h index 6a6022a21..9499c00e4 100644 --- a/include/hashcomp.h +++ b/include/hashcomp.h @@ -14,6 +14,7 @@ #ifndef _HASHCOMP_H_ #define _HASHCOMP_H_ +#include //#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 +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 +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(); }