xtd - Reference Guide  0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
xtd::iequatable< type_t > Class Template Referenceabstract

#include <iequatable.h>

Definition

template<typename type_t>
class xtd::iequatable< type_t >

Defines a generalized method that a value type or class implements to create a type-specific method for determining equality of instances.

Namespace
xtd
Library
xtd.core
Remarks
This interface is implemented by types whose values can be equated (for example, the numeric and string classes). A value type or class implements the equals method to create a type-specific method suitable for determining equality of instances.
The icomparable<T> interface defines the compare_to method, which determines the sort order of instances of the implementing type. The iequatable<T> interface defines the equals method, which determines the equality of instances of the implementing type.

Inherits xtd::interface.

Public Member Functions

virtual bool equals (const object &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 
virtual bool equals (const type_t &) const noexcept=0
 Indicates whether the current object is equal to another object of the same type.
 

Member Function Documentation

◆ equals() [1/2]

template<typename type_t >
virtual bool xtd::iequatable< type_t >::equals ( const object ) const
pure virtualnoexcept

Indicates whether the current object is equal to another object of the same type.

Parameters
objAn object to compare with this object.
Returns
true if the current object is equal to the other parameter; otherwise, false.

Implemented in xtd::guid, and xtd::net::ip_address.

◆ equals() [2/2]

template<typename type_t >
virtual bool xtd::iequatable< type_t >::equals ( const type_t &  ) const
pure virtualnoexcept

Indicates whether the current object is equal to another object of the same type.

Parameters
objAn object to compare with this object.
Returns
true if the current object is equal to the other parameter; otherwise, false.

Implemented in xtd::guid.


The documentation for this class was generated from the following file: