natural_sort Struct Reference

Encapsulation of natural order sorting for algorithms. More...

Classes

struct  greater
 A list compare binary predicate for reverse natural sort. More...
 
struct  less
 A list compare binary predicate for natural sort. More...
 
struct  reverse
 Reverse natural sorting. More...
 

Public Member Functions

bool operator() (const std::string &s1, const std::string &s2) const
 Default (forward) natural sorting. More...
 

Static Public Member Functions

static int compare (const std::string &s1, const std::string &s2)
 Natural compare for std::string. More...
 

Detailed Description

Encapsulation of natural order sorting for algorithms.

Definition at line 62 of file stringOpsSort.H.

Member Function Documentation

◆ compare()

static int compare ( const std::string &  s1,
const std::string &  s2 
)
inlinestatic

Natural compare for std::string.

Returns
-1 when s1 < s2, 0 when s1 == s2, 1 when s1 > s2

Definition at line 66 of file stringOpsSort.H.

Referenced by seriesLess::operator()(), natural_sort::less< T >::operator()(), natural_sort::greater< T >::operator()(), natural_sort::operator()(), and natural_sort::reverse::operator()().

Here is the caller graph for this function:

◆ operator()()

bool operator() ( const std::string &  s1,
const std::string &  s2 
) const
inline

Default (forward) natural sorting.

Definition at line 76 of file stringOpsSort.H.

References natural_sort::compare().

Here is the call graph for this function:

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