xtd 0.2.0
Loading...
Searching...
No Matches
comparer.h
Go to the documentation of this file.
1
4#pragma once
5#include "icomparer.h"
6//#include "../../comparison.h"
7#include "../../object.h"
8#include "../../ptr.h"
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.h: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.h: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.h:53
Exposes a method that compares two objects.
Definition icomparer.h:30
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h: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.h:10