Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Compare_Tnode< Tlink, Tnode, T, Compare > Class Template Reference

Helper class to compare nodes of a linked list. More...

#include <tpl_sort_utils.H>

Inheritance diagram for Aleph::Compare_Tnode< Tlink, Tnode, T, Compare >:
[legend]

Public Member Functions

 Compare_Tnode (Compare cmp_fct=Compare()) noexcept(std::is_nothrow_copy_constructible_v< Compare >)
 Construct from a comparison functor.
 
bool operator() (Tlink *l1, Tlink *l2) const noexcept(noexcept(std::declval< const Compare & >()(std::declval< const T & >(), std::declval< const T & >())))
 Compares two nodes based on their data.
 
bool operator() (Tlink *l, const T &x) const noexcept(noexcept(std::declval< const Compare & >()(std::declval< const T & >(), std::declval< const T & >())))
 Compares a node's data with a value.
 

Private Attributes

Compare cmp
 

Detailed Description

template<typename Tlink, template< class > class Tnode, typename T, class Compare>
class Aleph::Compare_Tnode< Tlink, Tnode, T, Compare >

Helper class to compare nodes of a linked list.

Adapts a comparison functor for elements of type T to work with list nodes of type Tnode<T>.

Template Parameters
TlinkBase link type (e.g., Dlink).
TnodeTemplate for the node type (e.g., Dnode).
TElement type.
CompareComparison functor for T.

Definition at line 480 of file tpl_sort_utils.H.

Constructor & Destructor Documentation

◆ Compare_Tnode()

template<typename Tlink , template< class > class Tnode, typename T , class Compare >
Aleph::Compare_Tnode< Tlink, Tnode, T, Compare >::Compare_Tnode ( Compare  cmp_fct = Compare())
inlinenoexcept

Construct from a comparison functor.

Definition at line 486 of file tpl_sort_utils.H.

Member Function Documentation

◆ operator()() [1/2]

template<typename Tlink , template< class > class Tnode, typename T , class Compare >
bool Aleph::Compare_Tnode< Tlink, Tnode, T, Compare >::operator() ( Tlink l,
const T x 
) const
inlinenoexcept

Compares a node's data with a value.

Definition at line 504 of file tpl_sort_utils.H.

References Aleph::Compare_Tnode< Tlink, Tnode, T, Compare >::cmp, Aleph::divide_and_conquer_partition_dp(), and l.

◆ operator()() [2/2]

template<typename Tlink , template< class > class Tnode, typename T , class Compare >
bool Aleph::Compare_Tnode< Tlink, Tnode, T, Compare >::operator() ( Tlink l1,
Tlink l2 
) const
inlinenoexcept

Compares two nodes based on their data.

Definition at line 492 of file tpl_sort_utils.H.

References Aleph::and, Aleph::Compare_Tnode< Tlink, Tnode, T, Compare >::cmp, Aleph::divide_and_conquer_partition_dp(), l1, and l2.

Member Data Documentation

◆ cmp


The documentation for this class was generated from the following file: