xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd
comparable
xtd::comparable< value_t > Struct Template Reference
﹡ libraries
»
xtd.core
|
system
»
concepts
Definition
template<typename value_t>
struct xtd::comparable< value_t >
Represents the comparable concept.
Definition
template
<
typename
value_t>
concept
xtd::comparable
=
xtd::less_than_comparable<value_t>
&&
xtd::greater_than_comparable<value_t>
;
xtd::comparable
Definition
comparable.hpp:12
xtd::greater_than_comparable
Definition
greater_than_comparable.hpp:13
xtd::less_than_comparable
Definition
less_than_comparable.hpp:13
Header
#include <xtd/comparable>
Namespace
xtd
Library
xtd.core
Examples
The following code shows how to use
xtd::comparable
concept
#include <xtd/xtd>
auto
get_max(
const
comparable
auto
& a,
const
comparable
auto
& b) {
return
a
>
b
?
a
:
b
;}
auto
get_min(
const
comparable
auto
& a,
const
comparable
auto
& b) {
return
a
<
b
?
a
:
b
;}
auto
main() ->
int
{
println(
"max = {}"
, get_max(42, 21));
println(
"max = {}"
, get_max(34.5, 62.8));
println(
"min = {}"
, get_min(version {1, 2, 4}, version {1, 2, 3}));
println
(
"min = {}"
, get_min(4_s + 122_ms, 12_s + 234_ms));
}
// This code produces the following output :
//
// max = 42
// max = 62.8
// min = 1.2.3
// min = 00:00:04.1220000
xtd::console_key::a
@ a
The A key.
Definition
console_key.hpp:88
xtd::console_key::b
@ b
The B key.
Definition
console_key.hpp:90
xtd::println
auto println(FILE *file) -> void
Writes the current line terminator to the file output stream using the specified format information.
Definition
println.hpp:14
The documentation for this struct was generated from the following file:
xtd.core/include/xtd/
comparable_.hpp
Generated on
for xtd by
Gammasoft
. All rights reserved.