xtd 0.2.0
comparer.hpp
Go to the documentation of this file.
1
4#pragma once
6#include "icomparer.hpp"
7//#include "../../comparison.hpp"
8#include "../../object.hpp"
9#include "../../ptr.hpp"
10
12namespace xtd {
14 namespace collections {
16 namespace generic {
32 template<class type_t>
33 class comparer : public object, public icomparer<type_t> {
34 public:
36
39 using first_argument_type = type_t;
41 using second_argument_type = type_t;
45
47
52
54
66 result_type compare(const first_argument_type& x, const second_argument_type& y) const noexcept override {return helpers::comparer<type_t> {} (x, y);}
67
68 //static ptr<comparer<type_t>> create (xtd::comparison<type_t> comparison) {
69 // return {};
70 //}
72
73 protected:
75
78 comparer() = default;
80 };
81
83 template<class type_t>
86 }
87 }
88}
Provides a base class for implementations of the xtd::collections::generic::icomparer <type_t> generi...
Definition comparer.hpp:33
comparer()=default
Initializes a new instance of the xtd::collections::generic::comparer <type_t> class.
result_type compare(const first_argument_type &x, const second_argument_type &y) const noexcept override
Compares two entities and returns a value indicating whether one is less than, equal to,...
Definition comparer.hpp:66
int32 result_type
Represents the result type.
Definition comparer.hpp:43
type_t first_argument_type
Represents the first argument type.
Definition comparer.hpp:39
static const comparer< type_t > default_comparer
Returns a default sort order comparer for the type specified by the generic argument.
Definition comparer.hpp:50
type_t second_argument_type
Represents the second argument type.
Definition comparer.hpp:41
Exposes a method that compares two objects.
Definition icomparer.hpp:30
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:43
Contains xtd::collections::generic::helpers::comparer struct.
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
@ y
The Y key.
@ x
The X key.
Contains xtd::collections::icomparer alias.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Implements a function object for compare data.
Definition comparer.hpp:31