Commit 4600fea0 authored by Tom Niget's avatar Tom Niget

Add hash support to PyStr

parent 123648e7
...@@ -55,4 +55,10 @@ template <typename T> PyStr repr(const T &x) { ...@@ -55,4 +55,10 @@ template <typename T> PyStr repr(const T &x) {
return s.str(); return s.str();
} }
template <> struct std::hash<PyStr> {
std::size_t operator()(const PyStr &s) const noexcept {
return std::hash<std::string>()(s);
}
};
#endif // TYPON_STR_HPP #endif // TYPON_STR_HPP
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment