Home | History | Annotate | Download | only in ADT

Lines Matching defs:hash_code

17 //  -- 'hash_code' class is an opaque type representing the hash code for some
21 // to assume much about the internals of a hash_code. In particular, each
23 // hash_code for a given input. Thus their values are not stable to save or
34 // a single hash_code for their object. They should only logically be used
67 /// In order to obtain the hash_code for an object 'x':
70 /// llvm::hash_code code = hash_value(x);
72 class hash_code {
76 /// \brief Default construct a hash_code.
78 hash_code() = default;
81 hash_code(size_t value) : value(value) {}
86 friend bool operator==(const hash_code &lhs, const hash_code &rhs) {
89 friend bool operator!=(const hash_code &lhs, const hash_code &rhs) {
93 /// \brief Allow a hash_code to be directly run through hash_value.
94 friend size_t hash_value(const hash_code &code) { return code.value; }
97 /// \brief Compute a hash_code for any integer value.
99 /// Note that this function is intended to compute the same hash_code for
105 typename std::enable_if<is_integral_or_enum<T>::value, hash_code>::type
108 /// \brief Compute a hash_code for a pointer's address.
111 template <typename T> hash_code hash_value(const T *ptr);
113 /// \brief Compute a hash_code for a pair of objects.
115 hash_code hash_value(const std::pair<T, U> &arg);
117 /// \brief Compute a hash_code for a standard string.
119 hash_code hash_value(const std::basic_string<T> &arg);
398 /// \brief Implement the combining of integral values into a hash_code.
401 /// integral. Rather than computing a hash_code for each object and then
404 hash_code hash_combine_range_impl(InputIteratorT first, InputIteratorT last) {
438 /// \brief Implement the combining of integral values into a hash_code.
442 /// a hash_code for each object and then combining them, this (as an
447 typename std::enable_if<is_hashable_data<ValueT>::value, hash_code>::type
473 /// \brief Compute a hash_code for a sequence of values.
475 /// This hashes a sequence of values. It produces the same hash_code as
480 hash_code hash_combine_range(InputIteratorT first, InputIteratorT last) {
555 hash_code combine(size_t length, char *buffer_ptr, char *buffer_end,
567 /// constructs a hash_code.
568 hash_code combine(size_t length, char *buffer_ptr, char *buffer_end) {
591 /// \brief Combine values into a single hash_code.
594 /// attempt to combine them into a single hash_code. For user-defined types it
597 /// resulting hash_code.
602 template <typename ...Ts> hash_code hash_combine(const Ts &...args) {
618 inline hash_code hash_integer_value(uint64_t value) {
632 typename std::enable_if<is_integral_or_enum<T>::value, hash_code>::type
640 template <typename T> hash_code hash_value(const T *ptr) {
648 hash_code hash_value(const std::pair<T, U> &arg) {
655 hash_code hash_value(const std::basic_string<T> &arg) {