Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::StrictWeakOrder Concept Reference

Strict weak ordering constraint for BST comparators. More...

#include <ah-concepts.H>

Concept definition

template<typename F, typename T>
std::strict_weak_order<F, T, T> and
std::strict_weak_order<const F &, const T &, const T &>
Strict weak ordering constraint for BST comparators.
and
Check uniqueness with explicit hash + equality functors.

Detailed Description

Strict weak ordering constraint for BST comparators.

Used by BST classes (Gen_Avl_Tree, Gen_Rb_Tree, etc.) to constrain the Compare template parameter. The stored comparator is invoked through both shapes depending on the call site: read-only paths bind it through a const tree (const F&), while mutating paths (insert(), search_and_stack_avl(), ...) hold the tree by a non-const this and invoke the cmp member as a non-const lvalue. If F overloads operator() differently for its const and non-const forms, checking only one shape lets a functor pass the constraint here and still fail deep inside tpl_avl.H on whichever shape wasn't checked — the exact failure mode this concept exists to catch. Requiring both shapes closes that gap while still accepting the common case of a single const operator() (callable through either shape, since a const method can be invoked from a non-const lvalue too).

Template Parameters
Ffunctor type.
Tkey type.

Definition at line 125 of file ah-concepts.H.