CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
equality_comparer.h
1
2#pragma once
3
4#include <system/collections/iequality_comparer.h>
5#include <system/object_ext.h>
6
7namespace System { namespace Collections { namespace Generic {
8
9template <typename T> class ObjectEqualityComparer;
10
13template<typename T>
15{
16public:
20
21public:
25 {
26 static SharedPtr<EqualityComparer> s_result = System::MakeObject<ObjectEqualityComparer<T>>();
27 return s_result;
28 }
29};
30
34template <typename T>
36{
37public:
41
42public:
46 bool Equals(T x, T y) const override
47 {
48 return System::ObjectExt::Equals(x, y);
49 }
50
54 int GetHashCode(T obj) const override
55 {
57 }
58};
59
60}}}
Provides a base class for implementations of the System::Collections::Generic::IEqualityComparer gene...
Definition: equality_comparer.h:15
RTTI_INFO_TEMPLATE_CLASS(System::Collections::Generic::EqualityComparer< T >, System::BaseTypesInfo< System::Collections::Generic::IEqualityComparer< T > >)
RTTI information.
static SharedPtr< EqualityComparer > get_Default()
Returns a default equality comparer for the type specified by the generic argument.
Definition: equality_comparer.h:24
Interface providing means to compare two objects for equality. Objects of this class should only be a...
Definition: iequality_comparer.h:18
Provides a default implementation of the System::Collections::Generic::EqualityComparer<T> abstract c...
Definition: equality_comparer.h:36
int GetHashCode(T obj) const override
Gets hash code for some object.
Definition: equality_comparer.h:54
RTTI_INFO_TEMPLATE_CLASS(System::Collections::Generic::ObjectEqualityComparer< T >, System::BaseTypesInfo< System::Collections::Generic::EqualityComparer< T > >)
RTTI information.
bool Equals(T x, T y) const override
Definition: equality_comparer.h:46
static int GetHashCode(const T &obj)
Implements GetHashCode() calls; works on both Object subclasses and unrelated types.
Definition: object_ext.h:30
static std::enable_if< IsExceptionWrapper< T >::value, bool >::type Equals(const T &obj, const T2 &another)
Definition: object_ext.h:36
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Definition: db_command.h:9