diff options
Diffstat (limited to 'include/llvm/ADT/Hashing.h')
-rw-r--r-- | include/llvm/ADT/Hashing.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/ADT/Hashing.h b/include/llvm/ADT/Hashing.h index 7bb540e833..e4dc613652 100644 --- a/include/llvm/ADT/Hashing.h +++ b/include/llvm/ADT/Hashing.h @@ -124,6 +124,10 @@ template <typename T> hash_code hash_value(const T *ptr); template <typename T, typename U> hash_code hash_value(const std::pair<T, U> &arg); +/// \brief Compute a hash_code for a standard string. +template <typename T> +hash_code hash_value(const std::basic_string<T> &arg); + /// \brief Override the execution seed with a fixed value. /// @@ -748,6 +752,13 @@ hash_code hash_value(const std::pair<T, U> &arg) { return hash_combine(arg.first, arg.second); } +// Declared and documented above, but defined here so that any of the hashing +// infrastructure is available. +template <typename T> +hash_code hash_value(const std::basic_string<T> &arg) { + return hash_combine_range(arg.begin(), arg.end()); +} + } // namespace llvm #endif |