xtd 0.2.0
Loading...
Searching...
No Matches
comparer.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "icomparer.hpp"
6//#include "../../comparison.hpp"
7#include "../../object.hpp"
8#include "../../ptr.hpp"
9
11namespace xtd {
13 namespace collections {
15 namespace generic {
31 template<typename type_t>
32 class comparer : public object, public icomparer<type_t> {
33 public:
35
40
42
53 int32 compare(const type_t& x, const type_t& y) const noexcept override {return x < y ? -1 : (x > y ? 1 : 0);}
54
55 //static ptr<comparer<type_t>> create (xtd::comparison<type_t> comparison) {
56 // return {};
57 //}
59
60 protected:
62
65 comparer() = default;
67 };
68
70 template<typename type_t>
73 }
74 }
75}
Provides a base class for implementations of the xtd::collections::generic::icomparer <type_t> generi...
Definition comparer.hpp:32
comparer()=default
Initializes a new instance of the xtd::collections::generic::comparer <type_t> class.
static const comparer< type_t > default_comparer
Returns a default sort order comparer for the type specified by the generic argument.
Definition comparer.hpp:38
int32 compare(const type_t &x, const type_t &y) const noexcept override
Compares two entities and returns a value indicating whether one is less than, equal to,...
Definition comparer.hpp:53
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:42
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
@ y
The Y key.
@ x
The X key.
Contains xtd::collections::generic::icomparer <type_t> interface.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10