5#define __XTD_STD_INTERNAL__
6#include "../internal/__xtd_std_version.hpp"
7#undef __XTD_STD_INTERNAL__
12 namespace extensions {
29 template<
typename type_t,
typename comparable_t>
39 friend bool operator <(
const type_t& lhs,
const type_t& rhs)
noexcept {
41 return dynamic_cast<const type_t*
>(rhs_ptr) && lhs.compare_to(
static_cast<const type_t&
>(rhs)) < 0;
48 friend bool operator <=(
const type_t& lhs,
const type_t& rhs)
noexcept {
50 return dynamic_cast<const type_t*
>(rhs_ptr) && lhs.compare_to(
static_cast<const type_t&
>(rhs)) <= 0;
57 friend bool operator >(
const type_t& lhs,
const type_t& rhs)
noexcept {
59 return dynamic_cast<const type_t*
>(rhs_ptr) && lhs.compare_to(
static_cast<const type_t&
>(rhs)) > 0;
66 friend bool operator >=(
const type_t& lhs,
const type_t& rhs)
noexcept {
68 return dynamic_cast<const type_t*
>(rhs_ptr) && lhs.compare_to(
static_cast<const type_t&
>(rhs)) >= 0;
71#if defined(__xtd__cpp_lib_three_way_comparison)
79 friend std::strong_ordering
operator <=>(
const type_t& lhs,
const type_t& rhs)
noexcept {
81 if (
dynamic_cast<const type_t*
>(rhs_ptr) && lhs.compare_to(
static_cast<const type_t&
>(rhs)) < 0)
return std::strong_ordering::less;
82 if (
dynamic_cast<const type_t*
>(rhs_ptr) && lhs.compare_to(
static_cast<const type_t&
>(rhs)) > 0)
return std::strong_ordering::greater;
83 if (
dynamic_cast<const type_t*
>(rhs_ptr) && lhs.compare_to(
static_cast<const type_t&
>(rhs)) == 0)
return std::strong_ordering::equivalent;
84 return std::strong_ordering::less;
Internal comparable operators definition.
Definition comparison_operators.hpp:30
friend std::strong_ordering operator<=>(const type_t &lhs, const type_t &rhs) noexcept
Three-way comparison operator with specidied lhs ans rhs values.
Definition comparison_operators.hpp:79
friend bool operator<(const type_t &lhs, const type_t &rhs) noexcept
Less than comparison operator with specidied lhs ans rhs values.
Definition comparison_operators.hpp:39
friend bool operator>=(const type_t &lhs, const type_t &rhs) noexcept
Less than comparison operator with specidied lhs ans rhs values.
Definition comparison_operators.hpp:66
friend bool operator<=(const type_t &lhs, const type_t &rhs) noexcept
Less than or equal to comparison operator with specidied lhs ans rhs values.
Definition comparison_operators.hpp:48
friend bool operator>(const type_t &lhs, const type_t &rhs) noexcept
Greater than or equal to comparison operator with specidied lhs ans rhs values.
Definition comparison_operators.hpp:57
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10