Core Library  1.7.0.0
Library containing core utilities and tools for threading, networking, logging, INI and CSV file management etc.
core_lib::sorting::Quick< T, Pred > Class Template Reference

Templated static class to perform a quick sort. More...

#include <GenericSorting.h>

Public Types

using item_compare = Pred
 Public typedef for predicate.
 

Static Public Member Functions

template<typename TIterator >
static void Sort (TIterator begin, TIterator end)
 In-place static sort function. More...
 

Detailed Description

template<typename T, typename Pred = std::less<T>>
class core_lib::sorting::Quick< T, Pred >

Templated static class to perform a quick sort.

Template args are T, the type of value to be sorted, and Pred, the comparison functor to compare items of type T. The default comparison predicate is std::less<T>. This is a recursive implementation of quick sort.

Member Function Documentation

◆ Sort()

template<typename T , typename Pred = std::less<T>>
template<typename TIterator >
static void core_lib::sorting::Quick< T, Pred >::Sort ( TIterator  begin,
TIterator  end 
)
inlinestatic

In-place static sort function.

Parameters
[in]begin- The begining of the collection to sort.
[in]end- The end of the collection to sort (in STL fashion this is the item just after the last item to be sorted).

This function sorts a collection (vector, list etc) of items of type T between a begin and end iterator.


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