17 template <
typename type_t>
32 virtual int32_t
compare_to(
const object& obj)
const noexcept {
33 if (!is<type_t>(&obj))
return 1;
34 return compare_to(static_cast<const type_t&>(obj));
46 virtual int32_t
compare_to(
const type_t& obj)
const noexcept = 0;
51 bool operator<(
const object& obj)
const noexcept {
return compare_to(obj) < 0; }
52 bool operator<=(
const object& obj)
const noexcept {
return compare_to(obj) <= 0; }
53 bool operator>(
const object& obj)
const noexcept {
return compare_to(obj) > 0; }
54 bool operator>=(
const object& obj)
const noexcept {
return compare_to(obj) >= 0; }
55 bool operator<(
const type_t& obj)
const noexcept {
return compare_to(obj) < 0; }
56 bool operator<=(
const type_t& obj)
const noexcept {
return compare_to(obj) <= 0; }
57 bool operator>(
const type_t& obj)
const noexcept {
return compare_to(obj) > 0; }
58 bool operator>=(
const type_t& obj)
const noexcept {
return compare_to(obj) >= 0; }
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition: icomparable.h:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
virtual int32_t compare_to(const object &obj) const noexcept
Compares the current instance with another object of the same type.
Definition: icomparable.h:32
Contains xtd::interface interface.
#define interface_
This keyword is use to represent an interface.
Definition: interface.h:55
Contains xtd::object class.