Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site













SourceForge.net Logo

Sorting template functions

 

template <class T, class Less> void Sort(T& c, const Less& less)

Sorts container c with ordering is defined by less. The order of elements with the same value can be changed (unstable sort).

IterSwap must be defined for IteratorOf<T>.

 


 

template <class T> void Sort(T& c)

Sorts container c with ordering is determined by operator<. The order of elements with the same value can be changed (unstable sort).

IterSwap must be defined for IteratorOf<T>.

 


 

template <class T, class Lessvoid StableSort(T& c, const Less& less)

Sorts container c with ordering is defined by less. The order of elements with the same value stays unchanged (stable sort).

IterSwap must be defined for IteratorOf<T>.

 


 

template <class Tvoid StableSort(T& c)

Sorts container c with ordering is determined by operator<.  The order of elements with the same value stays unchanged (stable sort).

IterSwap must be defined for IteratorOf<T>.

 


 

template <class KC, class VC, class Less> void IndexSort(KC& keys, VC& values, const Less& less)

Sorts pair of containers. Both containers must have same number of items. Resulting order is defined by the keys container. Ordering is defined by less.

 


 

template <class KC, class VC> void IndexSort(KC& keys, VC& values)

Sorts pair of containers. Both containers must have same number of items. Resulting order is determined by the keys container. Ordering is determined by operator<.

 


 

template <class C, class Less> Vector<int> GetSortOrder(const C& container, const Less& less)

Creates ascending order of values in container. Ordering is determined by less. The order of elements with the same value can be changed (unstable sort).

 


 

template <class C> Vector<int> GetSortOrder(const C& container)

Creates ascending order of values in container. Ordering is determined by operator<. The order of elements with the same value can be changed (unstable sort).

 

 


 

template <class C, class LessVector<intGetStableSortOrder(const C& container, const Less& less)

Creates ascending order of values in container. Ordering is determined by less. The order of elements with the same value stays unchanged (stable sort).

 


 

template <class CVector<intGetStableSortOrder(const C& container)

Creates ascending order of values in container. Ordering is determined by operator<. The order of elements with the same value stays unchanged (stable sort).

 


 

template <class Map, class Lessvoid SortByKey(Map& map, const Less& less)

Sorts VectorMap or ArrayMap (or any other hypothetical container that supports required interfaces) map by keys, using less as sorting predicate.

 


 

template <class Mapvoid SortByKey(Map& map)

Sorts VectorMap or ArrayMap (or any other hypothetical container that supports required interfaces) map by keys, using operator< as sorting predicate.

 


 

template <class Map, class Lessvoid SortByValue(Map& map, const Less& less)

Sorts VectorMap or ArrayMap (or any other hypothetical container that supports required interfaces) map by values, using less as sorting predicate.

 


 

template <class Mapvoid SortByValue(Map& map)

Sorts VectorMap or ArrayMap (or any other hypothetical container that supports required interfaces) map by values, using operator< as sorting predicate.

 


 

template <class Map, class Lessvoid StableSortByKey(Map& map, const Less& less)

Sorts VectorMap or ArrayMap (or any other hypothetical container that supports required interfaces) map by keys, using less as sorting predicate. Stable: retains the order of equal elements.

 


 

template <class Mapvoid StableSortByKey(Map& map)

Sorts VectorMap or ArrayMap (or any other hypothetical container that supports required interfaces) map by keys, using operator< as sorting predicate. Stable: retains the order of equal elements.

 


 

template <class Map, class Lessvoid StableSortByValue(Map& map, const Less& less)

Sorts VectorMap or ArrayMap (or any other hypothetical container that supports required interfaces) map by values, using less as sorting predicate. Stable: retains the order of equal elements.

 


 

template <class Mapvoid StableSortByValue(Map& map)

Sorts VectorMap or ArrayMap (or any other hypothetical container that supports required interfaces) map by values, using operator< as sorting predicate. Stable: retains the order of equal elements.

 


 

template <class Index, class Lessvoid SortIndex(Index& index, const Less& less)

Sorts Index or ArrayIndex using less as sorting predicate.

 


 

template <class Indexvoid SortIndex(Index& index)

Sorts Index or ArrayIndex.

 


 

template <class Index, class Lessvoid StableSortIndex(Index& index, const Less& less)

Sorts Index or ArrayIndex using less as sorting predicate. Stable: retains the order of equal elements.

 


 

template <class Indexvoid StableSortIndex(Index& index)

Sorts Index or ArrayIndex.  Stable: retains the order of equal elements.

 

Last edit by cxl on 11/20/2016. Do you want to contribute?. T++