|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Strict weak ordering constraint for BST comparators. More...
#include <ah-concepts.H>
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).
| F | functor type. |
| T | key type. |
Definition at line 125 of file ah-concepts.H.