|
xtd
0.2.0
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
7#if !defined(__XTD_CORE_INTERNAL__)
8#error "Do not include this file: Internal use only"
12#include "../icomparable.hpp"
13#include "../int32.hpp"
19template<
typename type_t,
typename bool_t>
20struct __icomparable_comparer__ {};
22template<
typename type_t>
23struct __icomparable_comparer__<type_t, std::true_type> {
27template<
typename type_t>
28struct __icomparable_comparer__<type_t, std::false_type> {
29 xtd::int32 operator()(
const type_t& x,
const type_t& y)
const {
return x <
y ? -1 : (
x >
y ? 1 : 0);}
32template<
class type_t,
class bool_t>
33struct __polymorphic_comparer__ {};
36struct __polymorphic_comparer__<type_t, std::true_type> {
37 xtd::int32 operator()(
const type_t& x,
const type_t& y)
const {
return __icomparable_comparer__<type_t, typename std::is_base_of<xtd::icomparable<type_t>, type_t>::type> {}(
x,
y);}
41struct __polymorphic_comparer__<type_t, std::false_type> {
42 xtd::int32 operator()(
const type_t& x,
const type_t& y)
const {
return x <
y ? -1 : (
x >
y ? 1 : 0);}
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.hpp:21
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23