xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.core
include
xtd
extensions
comparison_operators.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#define __XTD_STD_INTERNAL__
6
#include "
../internal/__xtd_std_version.hpp
"
7
#undef __XTD_STD_INTERNAL__
8
#include <compare>
9
11
namespace
xtd
{
13
namespace
extensions
{
30
template
<
typename
type_t,
typename
comparable_t>
31
class
comparison_operators {
32
public
:
34
43
friend
auto
operator <=>
(
const
type_t& lhs,
const
type_t& rhs)
noexcept
-> std::strong_ordering {
44
if
(lhs.compare_to(rhs) < 0)
return
std::strong_ordering::less;
45
if
(lhs.compare_to(rhs) > 0)
return
std::strong_ordering::greater;
46
return
std::strong_ordering::equivalent;
47
}
48
49
50
private
:
51
friend
comparable_t;
52
comparison_operators
() =
default
;
53
};
54
}
55
}
__xtd_std_version.hpp
xtd::extensions::comparison_operators
Internal comparable operators definition.
Definition
comparison_operators.hpp:31
xtd::extensions::comparison_operators::operator<=>
friend auto operator<=>(const type_t &lhs, const type_t &rhs) noexcept -> std::strong_ordering
Three-way comparison operator with specidied lhs ans rhs values.
Definition
comparison_operators.hpp:43
xtd::extensions
The xtd::extensions namespace contains interface extensions.
Definition
comparison_operators.hpp:13
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
Generated on
for xtd by
Gammasoft
. All rights reserved.