ComparerAdapter

ComparerAdapter struct

Adapter to use IComparer within STL environment. Uses IComparer if set; otherwise, uses operator < (if available) or returns false (if not).

template<class T>class ComparerAdapter

Template parameters

ParameterDescription
TType being compared.

Methods

MethodDescription
ComparerAdapter()Constructs adapter without any comparator available.
ComparerAdapter(const SharedPtr<System::Collections::Generic::IComparer<T>>&)Constructs adapter.
std::enable_if<detail::has_operator_less<Q>::value, bool>::type operator()(const Q&, const Q&) constComparison function for types with operator < available.
std::enable_if<!detail::has_operator_less<Q>::value, bool>::type operator()(const Q&, const Q&) constComparison function for types with operator < not available.
void set_Comparator(const SharedPtr<IComparer<T>>&)Sets comparator object.

See Also