ORIGINAL
Loading...
Searching...
No Matches
original::Compare Concept Reference

Combines Comparable and CallbackOf for comparison callbacks. More...

#include <types.h>

Concept definition

template<typename Callback, typename TYPE>
Combines Comparable and CallbackOf for comparison callbacks.
Definition types.h:377
Constraint for boolean predicate callbacks.
Definition types.h:357

Detailed Description

Combines Comparable and CallbackOf for comparison callbacks.

Template Parameters
CallbackComparison function type
TYPEType being compared

Requires a callback that takes two TYPE references and returns bool.

// Validates custom comparator
auto int_comparator = [](const int& a, const int& b) { return a < b; };
static_assert(Compare<decltype(int_comparator), int>); // Passes
// Invalid example (wrong return type)
auto bad_comp = [](const int& a, const int& b) { return a - b; };
static_assert(!Compare<decltype(bad_comp), int>); // Fails: returns int instead of bool
Unique ownership smart pointer with move semantics.
Definition ownerPtr.h:37