Core Library 1.7.0.0 Library containing core utilities and tools for threading, networking, logging, INI and CSV file management etc.

Public Types | Static Public Member Functions | List of all members
core_lib::sorting::Bubble< T, Pred > Class Template Reference

Templated static class to perform a bubble 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::Bubble< T, Pred >

Templated static class to perform a bubble 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>.

## Member Function Documentation

## ◆ Sort()

template<typename T , typename Pred = std::less<T>>
template<typename TIterator >

static void core_lib::sorting::Bubble< T, Pred >::Sort | ( | TIterator | begin,
|  | TIterator | end
| ) |  |
| inline static

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 otem 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:

- D:/Projects/CoreLibrary/Include/Sorting/GenericSorting.h