xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.core
include
xtd
collections
generic
equality_comparer.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#include "
iequality_comparer.hpp
"
6
#include "
helpers/equator.hpp
"
7
#include "
helpers/hasher.hpp
"
8
10
namespace
xtd
{
12
namespace
collections
{
14
namespace
generic
{
34
template
<
typename
type_t>
35
class
equality_comparer :
public
xtd::collections::generic::iequality_comparer
<type_t> {
36
public
:
38
42
static
auto
default_equality_comparer
() ->
const
equality_comparer& {
43
static
auto
result = equality_comparer {};
44
return
result;
45
}
46
47
49
59
[[nodiscard]]
auto
equals
(
const
type_t&
x
,
const
type_t&
y
)
const
noexcept
->
bool
override
{
return
xtd::collections::generic::helpers::equator<type_t>
{}(
x
,
y
);}
60
67
[[nodiscard]]
auto
get_hash_code
(
const
type_t& obj)
const
noexcept
->
xtd::usize
override
{
return
xtd::collections::generic::helpers::hasher<type_t>
{}(obj);}
69
70
private
:
71
equality_comparer
() =
default
;
72
};
73
}
74
}
75
}
xtd::collections::generic::equality_comparer
Provides a base class for implementations of the xtd::collections::generic::iequality_comparer <type_...
Definition
equality_comparer.hpp:35
xtd::collections::generic::equality_comparer::get_hash_code
auto get_hash_code(const type_t &obj) const noexcept -> xtd::usize override
Returns a hash code for the specified object.
Definition
equality_comparer.hpp:67
xtd::collections::generic::equality_comparer::default_equality_comparer
static auto default_equality_comparer() -> const equality_comparer &
Gets the default equality comparer for the type specified by the generic argument.
Definition
equality_comparer.hpp:42
xtd::collections::generic::equality_comparer::equals
auto equals(const type_t &x, const type_t &y) const noexcept -> bool override
Determines whether the specified objects are equal.
Definition
equality_comparer.hpp:59
xtd::collections::generic::iequality_comparer
Defines methods to support the comparison of objects for equality.
Definition
iequality_comparer.hpp:34
equator.hpp
Contains xtd::collections::generic::helpers::equator struct.
iequality_comparer.hpp
Contains xtd::collections::generic::iequality_comparer <type_t> interface.
xtd::usize
std::size_t usize
Represents an unsigned size of any object in bytes.
Definition
usize.hpp:22
xtd::console_key::y
@ y
The Y key.
Definition
console_key.hpp:136
xtd::console_key::x
@ x
The X key.
Definition
console_key.hpp:134
hasher.hpp
Contains xtd::collections::generic::helpers::hasher struct.
xtd::collections::generic
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition
comparer.hpp:16
xtd::collections
The xtd::collections namespace contains interfaces and classes that define various collections of obj...
Definition
any_pair.hpp:10
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
xtd::collections::generic::helpers::equator
Implements a function object for performing comparisons. Unless specialised, invokes operator== on ty...
Definition
equator.hpp:39
xtd::collections::generic::helpers::hasher
Implements a function object for hashing data.
Definition
hasher.hpp:40
Generated on
for xtd by
Gammasoft
. All rights reserved.