Lines Matching refs:H
90 template <typename H>
91 H add_buffer(H state, const unsigned char* data, size_t size);
92 template <typename H>
93 H add_buffer(H state, const char* data, size_t size) { in add_buffer()
107 template <typename H>
108 H finalize(H state);
142 template <typename H>
163 static H combine(H state, const T& value, const Ts&... values);
164 static H combine(H state) { return state; } in combine()
179 static H combine_contiguous(H state, const T* data, size_t size);
246 template <typename H, typename T>
247 H hash_bytes(H hash_state, const T& value) {
249 return H::combine_contiguous(std::move(hash_state), start, sizeof(value));
265 template <typename H, typename B>
266 typename std::enable_if<std::is_same<B, bool>::value, H>::type AbslHashValue(
267 H hash_state, B value) {
268 return H::combine(std::move(hash_state),
273 template <typename H, typename Enum>
274 typename std::enable_if<std::is_enum<Enum>::value, H>::type AbslHashValue(
275 H hash_state, Enum e) {
281 return H::combine(std::move(hash_state),
285 template <typename H, typename Float>
288 H>::type
289 AbslHashValue(H hash_state, Float value) {
298 template <typename H, typename LongDouble>
299 typename std::enable_if<std::is_same<LongDouble, long double>::value, H>::type
300 AbslHashValue(H hash_state, LongDouble value) {
305 hash_state = H::combine(std::move(hash_state), std::signbit(value));
323 hash_state = H::combine(std::move(hash_state), mantissa, exp);
326 return H::combine(std::move(hash_state), category);
330 template <typename H, typename T>
331 H AbslHashValue(H hash_state, T* ptr) {
337 return H::combine(std::move(hash_state), v, v);
341 template <typename H>
342 H AbslHashValue(H hash_state, std::nullptr_t) {
343 return H::combine(std::move(hash_state), static_cast<void*>(nullptr));
358 template <typename H, typename T1, typename T2>
360 H>::type
361 AbslHashValue(H hash_state, const std::pair<T1, T2>& p) {
362 return H::combine(std::move(hash_state), p.first, p.second);
369 template <typename H, typename Tuple, size_t... Is>
370 H hash_tuple(H hash_state, const Tuple& t, absl::index_sequence<Is...>) {
371 return H::combine(std::move(hash_state), std::get<Is>(t)...);
375 template <typename H, typename... Ts>
379 H
381 typename std::enable_if<absl::conjunction<is_hashable<Ts>...>::value, H>::type
383 AbslHashValue(H hash_state, const std::tuple<Ts...>& t) {
393 template <typename H, typename T, typename D>
394 H AbslHashValue(H hash_state, const std::unique_ptr<T, D>& ptr) {
395 return H::combine(std::move(hash_state), ptr.get());
399 template <typename H, typename T>
400 H AbslHashValue(H hash_state, const std::shared_ptr<T>& ptr) {
401 return H::combine(std::move(hash_state), ptr.get());
422 template <typename H>
423 H AbslHashValue(H hash_state, absl::string_view str) {
424 return H::combine(
425 H::combine_contiguous(std::move(hash_state), str.data(), str.size()),
430 template <typename Char, typename Alloc, typename H,
434 H AbslHashValue(
435 H hash_state,
437 return H::combine(
438 H::combine_contiguous(std::move(hash_state), str.data(), str.size()),
447 template <typename H, typename T, size_t N>
448 typename std::enable_if<is_hashable<T>::value, H>::type AbslHashValue(
449 H hash_state, const std::array<T, N>& array) {
450 return H::combine_contiguous(std::move(hash_state), array.data(),
455 template <typename H, typename T, typename Allocator>
456 typename std::enable_if<is_hashable<T>::value, H>::type AbslHashValue(
457 H hash_state, const std::deque<T, Allocator>& deque) {
461 hash_state = H::combine(std::move(hash_state), t);
463 return H::combine(std::move(hash_state), deque.size());
467 template <typename H, typename T, typename Allocator>
468 typename std::enable_if<is_hashable<T>::value, H>::type AbslHashValue(
469 H hash_state, const std::forward_list<T, Allocator>& list) {
472 hash_state = H::combine(std::move(hash_state), t);
475 return H::combine(std::move(hash_state), size);
479 template <typename H, typename T, typename Allocator>
480 typename std::enable_if<is_hashable<T>::value, H>::type AbslHashValue(
481 H hash_state, const std::list<T, Allocator>& list) {
483 hash_state = H::combine(std::move(hash_state), t);
485 return H::combine(std::move(hash_state), list.size());
492 template <typename H, typename T, typename Allocator>
494 H>::type
495 AbslHashValue(H hash_state, const std::vector<T, Allocator>& vector) {
496 return H::combine(H::combine_contiguous(std::move(hash_state), vector.data(),
506 template <typename H, typename Key, typename T, typename Compare,
509 H>::type
510 AbslHashValue(H hash_state, const std::map<Key, T, Compare, Allocator>& map) {
512 hash_state = H::combine(std::move(hash_state), t);
514 return H::combine(std::move(hash_state), map.size());
518 template <typename H, typename Key, typename T, typename Compare,
521 H>::type
522 AbslHashValue(H hash_state,
525 hash_state = H::combine(std::move(hash_state), t);
527 return H::combine(std::move(hash_state), map.size());
531 template <typename H, typename Key, typename Compare, typename Allocator>
532 typename std::enable_if<is_hashable<Key>::value, H>::type AbslHashValue(
533 H hash_state, const std::set<Key, Compare, Allocator>& set) {
535 hash_state = H::combine(std::move(hash_state), t);
537 return H::combine(std::move(hash_state), set.size());
541 template <typename H, typename Key, typename Compare, typename Allocator>
542 typename std::enable_if<is_hashable<Key>::value, H>::type AbslHashValue(
543 H hash_state, const std::multiset<Key, Compare, Allocator>& set) {
545 hash_state = H::combine(std::move(hash_state), t);
547 return H::combine(std::move(hash_state), set.size());
555 template <typename H, typename T>
556 typename std::enable_if<is_hashable<T>::value, H>::type AbslHashValue(
557 H hash_state, std::reference_wrapper<T> opt) {
558 return H::combine(std::move(hash_state), opt.get());
562 template <typename H, typename T>
563 typename std::enable_if<is_hashable<T>::value, H>::type AbslHashValue(
564 H hash_state, const absl::optional<T>& opt) {
565 if (opt) hash_state = H::combine(std::move(hash_state), *opt);
566 return H::combine(std::move(hash_state), opt.has_value());
570 template <typename H>
572 H&& hash_state;
574 H operator()(const T& t) const {
575 return H::combine(std::move(hash_state), t);
580 template <typename H, typename... T>
581 typename std::enable_if<conjunction<is_hashable<T>...>::value, H>::type
582 AbslHashValue(H hash_state, const absl::variant<T...>& v) {
584 hash_state = absl::visit(VariantVisitor<H>{std::move(hash_state)}, v);
586 return H::combine(std::move(hash_state), v.index());
604 template <typename H, typename T>
605 typename std::enable_if<is_uniquely_represented<T>::value, H>::type
606 hash_range_or_bytes(H hash_state, const T* data, size_t size) {
608 return H::combine_contiguous(std::move(hash_state), bytes, sizeof(T) * size);
612 template <typename H, typename T>
613 typename std::enable_if<!is_uniquely_represented<T>::value, H>::type
614 hash_range_or_bytes(H hash_state, const T* data, size_t size) {
616 hash_state = H::combine(std::move(hash_state), *data);
646 template <typename H, typename T>
647 static auto Invoke(H state, const T& value)
648 -> absl::enable_if_t<is_uniquely_represented<T>::value, H> {
654 template <typename H, typename T>
655 static auto Invoke(H state, const T& value) -> absl::enable_if_t<
656 std::is_same<H,
658 H> {
665 template <typename H, typename T>
666 static auto Invoke(H state, const T& value) -> absl::enable_if_t<
670 H> {
679 template <typename H, typename T>
680 static auto Invoke(H state, const T& value)
681 -> absl::enable_if_t<type_traits_internal::IsHashable<T>::value, H> {
689 template <typename H, typename = decltype(H::Invoke(
937 template <typename H>
939 H HashStateBase<H>::combine(H state, const T& value, const Ts&... values) {
940 return H::combine(hash_internal::HashSelect::template Apply<T>::Invoke(
946 template <typename H>
948 H HashStateBase<H>::combine_contiguous(H state, const T* data, size_t size) {
953 template <typename H>
954 H PiecewiseCombiner::add_buffer(H state, const unsigned char* data,
968 state = H::combine_contiguous(std::move(state), buf_, PiecewiseChunkSize());
975 state = H::combine_contiguous(std::move(state), data, PiecewiseChunkSize());
986 template <typename H>
987 H PiecewiseCombiner::finalize(H state) {
989 return H::combine_contiguous(std::move(state), buf_, position_);