Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ah-concepts.H File Reference

C++20 concepts for constraining comparison functors. More...

#include <concepts>
#include <type_traits>
Include dependency graph for ah-concepts.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 

Concepts

concept  Aleph::BinaryPredicate
 A callable that takes two const T& and returns bool.
 
concept  Aleph::StrictWeakOrder
 Strict weak ordering constraint for BST comparators.
 
concept  Aleph::EqualityComparator
 Equivalence relation constraint for equality comparators.
 
concept  Aleph::BSTPolicy
 Concept for BST tree policies used by DynSetTree.
 
concept  Aleph::AlephArrayConvertible
 Concept that identifies types that can be converted or used as an Aleph Array.
 
concept  Aleph::AlephSequentialContainer
 Concept for Aleph-w mutable sequential containers.
 
concept  Aleph::AlephSequentialIterableContainer
 Concept for Aleph-w sequential containers that can be iterated.
 
concept  Aleph::IntegerSortableValue
 Integral value accepted by linear-time integer sorting algorithms.
 

Detailed Description

C++20 concepts for constraining comparison functors.

Defines three concepts used throughout Aleph-w to constrain template parameters that act as binary predicates:

  • BinaryPredicate<F, T> — base concept: f(a, b) returns something convertible to bool.
  • StrictWeakOrder<F, T> — wraps std::strict_weak_order<F, T, T> for BST comparators.
  • EqualityComparator<F, T> — wraps std::equivalence_relation<F, T, T> for hash table equality comparators.

Using distinct concept names produces clear error messages: a BST constraint failure mentions "StrictWeakOrder", while a hash table failure mentions "EqualityComparator".

Author
Leandro Rabindranath Leon

Definition in file ah-concepts.H.