17 template <
typename type_t>
29 virtual int32_t
compare_to(
const object& obj)
const noexcept {
30 if (!is<type_t>(&obj))
return 1;
31 return compare_to(
static_cast<const type_t&
>(obj));
43 virtual int32_t
compare_to(
const type_t& obj)
const noexcept = 0;
47 bool operator<(
const object& obj)
const noexcept {
return compare_to(obj) < 0; }
48 bool operator<=(
const object& obj)
const noexcept {
return compare_to(obj) <= 0; }
49 bool operator>(
const object& obj)
const noexcept {
return compare_to(obj) > 0; }
50 bool operator>=(
const object& obj)
const noexcept {
return compare_to(obj) >= 0; }
51 bool operator<(
const type_t& obj)
const noexcept {
return compare_to(obj) < 0; }
52 bool operator<=(
const type_t& obj)
const noexcept {
return compare_to(obj) <= 0; }
53 bool operator>(
const type_t& obj)
const noexcept {
return compare_to(obj) > 0; }
54 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
virtual int32_t compare_to(const object &obj) const noexcept
Compares the current instance with another object of the same type.
Definition: icomparable.h:29
virtual int32_t compare_to(const type_t &obj) const noexcept=0
Compares the current instance with another object of the same type.
#define interface_
This keyword is use to represent an interface.
Definition: interface.h:55
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.