xtd 0.2.0
Loading...
Searching...
No Matches
xtd::collections::generic::helpers::comparer< type_t > Struct Template Reference

Definition

template<class type_t = void>
struct xtd::collections::generic::helpers::comparer< type_t >

Implements a function object for compare data.

struct comparer;
comparer()=default
Initializes a new instance of the comparer.
Header
#include <xtd/collections/generic/helpers/comparer>
Namespace
xtd::collections::generic::helpers
Library
xtd.core

Public Aliases

using first_argument_type
 Represents the first argument type.
 
using second_argument_type
 Represents the second argument type.
 
using result_type
 Represents the result type.
 

Public Constructors

 comparer ()=default
 Initializes a new instance of the comparer.
 
 comparer (const xtd::collections::generic::icomparer< type_t > &comparer)
 Initializes a new instance of the comparer with specified comparer.
 

Public Operators

constexpr auto operator() (const first_argument_type &x, const second_argument_type &y) const -> result_type
 Compares two entities and returns a value indicating whether one is less than, equal to, or greater than the other.
 

Member Typedef Documentation

◆ first_argument_type

template<class type_t = void>
using xtd::collections::generic::helpers::comparer< type_t >::first_argument_type

Represents the first argument type.

◆ second_argument_type

template<class type_t = void>
using xtd::collections::generic::helpers::comparer< type_t >::second_argument_type

Represents the second argument type.

◆ result_type

template<class type_t = void>
using xtd::collections::generic::helpers::comparer< type_t >::result_type

Represents the result type.

Constructor & Destructor Documentation

◆ comparer() [1/2]

template<class type_t = void>
xtd::collections::generic::helpers::comparer< type_t >::comparer ( )
default

Initializes a new instance of the comparer.

◆ comparer() [2/2]

template<class type_t = void>
xtd::collections::generic::helpers::comparer< type_t >::comparer ( const xtd::collections::generic::icomparer< type_t > & comparer)
inlineexplicit

Initializes a new instance of the comparer with specified comparer.

Parameters
comparerA comparer used to hash the key.

Member Function Documentation

◆ operator()()

template<class type_t = void>
auto xtd::collections::generic::helpers::comparer< type_t >::operator() ( const first_argument_type & x,
const second_argument_type & y ) const -> result_type
inlineconstexpr

Compares two entities and returns a value indicating whether one is less than, equal to, or greater than the other.

Parameters
xThe first entity to compare.
yThe second entity to compare.
Returns
A 32-bit signed integer that indicates the relative order of the entities being compared. The return value has these meanings:
Value Condition
Less than zero x is less than y.
Zero x equals y.
Greater than zero x is greater than y.

The documentation for this struct was generated from the following file:
  • xtd.core/include/xtd/collections/generic/helpers/comparer.hpp