SimpleSort< COMPARE, FLAGS > Class Template Reference

#include <sort.h>

Inheritance diagram for SimpleSort< COMPARE, FLAGS >:

Detailed Description

template<typename COMPARE = DefaultCompare, BASESORTFLAGS FLAGS = BASESORTFLAGS::NONE>
class maxon::SimpleSort< COMPARE, FLAGS >

Specialized BaseSort template for simple datatypes.

Template Parameters
COMPAREClass that offers the methods IsEqual and LessThan.
FLAGSSee BASESORTFLAGS.
Note
Note that the classes that will be sorted have special requirements regarding copy and move constructors .
Note that the comparison must fulfill the condition (a < b) == !(b < a). If this is not the case the sort algorithm will crash. To avoid mistakes when comparing tuples use LexicographicalCompare.

Example:

BaseArray<Int> array;
SimpleSort<> test;
test.Sort(array);
#define test
Definition: graminit.h:53

or

BaseArray<Int> array2;
SimpleSort<> test2;
test2.Sort(&array2[0], array2.GetCount());

Static Public Member Functions

template<typename T1 , typename T2 >
static Bool LessThan (const T1 &a, const T2 &b)
 
template<typename T1 , typename T2 >
static Bool IsEqual (const T1 &a, const T2 &b)
 

Additional Inherited Members

- Public Member Functions inherited from BaseSort< SimpleSort< DefaultCompare, BASESORTFLAGS::NONE >, BASESORTFLAGS::NONE >
void Sort (ITERATOR start, ITERATOR end) const
 
void Sort (ITERATOR start, Int count) const
 
void Sort (ARRAY &arr) const
 
Int FindIndex (const SEARCHTYPE &key, ITERATOR arr, Int count) const
 
ITERATOR Find (const SEARCHTYPE &key, ITERATOR arr, Int count) const
 
ARRAY::ValueType * Find (const SEARCHTYPE &key, const ARRAY &arr) const
 
ITERATOR FindInsertionIndex (const SEARCHTYPE &key, ITERATOR arr, Int count, Int &insertionIndex) const
 
ARRAY::ValueType * FindInsertionIndex (const SEARCHTYPE &key, const ARRAY &arr, Int &insertionIndex) const
 

Member Function Documentation

◆ LessThan()

static Bool LessThan ( const T1 &  a,
const T2 &  b 
)
static

◆ IsEqual()

static Bool IsEqual ( const T1 &  a,
const T2 &  b 
)
static