xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
iequatable.h
Go to the documentation of this file.
1 #pragma once
5 #include "interface.h"
6 #include "object.h"
7 
9 namespace xtd {
10  template<typename type_t>
20  public:
24  virtual bool equals(const type_t&) const noexcept = 0;
25 
29  virtual bool equals(const object&) const noexcept = 0;
30 
32  // Not correct for an interface but necessary for C++ language.
33  friend bool operator==(const type_t& a, const type_t& b) {return a.equals(b);}
34  friend bool operator!=(const type_t& a, const type_t& b) {return !a.equals(b);}
35  friend bool operator==(const type_t& a, const object& b) {return a.equals(b);}
36  friend bool operator!=(const type_t& a, const object& b) {return !a.equals(b);}
38  };
39 }
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:19
virtual bool equals(const type_t &) const noexcept=0
Indicates whether the current object is equal to another object of the same type.
virtual bool equals(const object &) const noexcept=0
Indicates whether the current object is equal to another object of the same type.
#define interface_
This keyword is use to represent an interface.
Definition: interface.h:55
@ a
The A key.
@ b
The B key.
Contains xtd::interface interface.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::object class.