xtd - Reference Guide  0.2.0
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:
22 
27  virtual bool equals(const type_t&) const noexcept = 0;
28 
32  virtual bool equals(const object&) const noexcept = 0;
34 
36  // Not correct for an interface but necessary for C++ language.
37  friend bool operator==(const type_t& a, const type_t& b) {return a.equals(b);}
38  friend bool operator!=(const type_t& a, const type_t& b) {return !a.equals(b);}
39  friend bool operator==(const type_t& a, const object& b) {return a.equals(b);}
40  friend bool operator!=(const type_t& a, const object& b) {return !a.equals(b);}
42  };
43 }
virtual bool equals(const type_t &) const noexcept=0
Indicates whether the current object is equal to another object of the same type. ...
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Contains xtd::interface interface.
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition: iequatable.h:19
#define interface_
This keyword is use to represent an interface.
Definition: interface.h:55
Contains xtd::object class.