75 if (comparer)
return comparer->get_hash_code(key);
76 if constexpr(std::is_polymorphic_v<argument_type> && std::is_base_of_v<xtd::ihashable, argument_type>)
return static_cast<const xtd::ihashable&
>(key).
get_hash_code();
77 else if constexpr(std::is_polymorphic_v<argument_type> && std::is_base_of_v<xtd::object, argument_type>)
return static_cast<const xtd::object&
>(key).
get_hash_code();
78 else if constexpr(std::is_invocable_v<std::hash<argument_type>,
const argument_type&>)
return std::hash<argument_type> {}(key);
79 else return std::hash<std::intptr_t> {}(
reinterpret_cast<std::intptr_t
>(&key));
Defines methods to support the comparison of objects for equality.
Definition iequality_comparer.hpp:34
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition ihashable.hpp:21
virtual xtd::size get_hash_code() const noexcept=0
Serves as a hash function for a particular type.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
virtual xtd::size get_hash_code() const noexcept
Serves as a hash function for a particular type.
Contains xtd::collections::generic::iequality_comparer <type_t> interface.
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
Contains xtd::ihashable interface.
The xtd::collections::generic::helpers namespace contains helpers for generic collections,...
Definition allocator.hpp:14
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:16
The xtd::collections namespace contains interfaces and classes that define various collections of obj...
Definition any_pair.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::object class.
Implements a function object for compare data.
Definition comparer.hpp:32
key_t argument_type
Represents the argument type.
Definition hasher.hpp:45
xtd::size result_type
Represents the result type.
Definition hasher.hpp:47
hasher() noexcept=default
Initializes a new instance of the hasher.