sincerely Singaporean

If you have not done so, read this full tutorial on how to use SGEXTN to build an application.

SGLSort

see header file

(no source file, everything inside header)

template ‹typename T, typename Comparator› class SGLSort;

part of SGEXTN module SG_Containers

static functions class for sorting array-like data

detailed description

list of all including inherited members

implementation details

preprocessor file inclusion directive: #include ‹SGLSort.h›

CMake target for BuildLah: SGEXTN::SG_Containers

see this link for more information about BuildLah

parent class: (none)

children classes: (none)

static member functions

static void sort(T* start, T* end);

Detailed Description

SGLSort provides a template based static functions class to sort array-like data structures. It works with any SGEXTN container data structure that provides pointerToData(). Specify the type of data to sort and the comparator to use as template arguments. This is a template based class with no separate source file.

Implementation Details

SGLSort uses IntroSort, the same algorithm that the C++ Standard Template Library uses.

static void sort(T* start, T* end);

Sorts the data structure from start (inclusive) to end (exclusive), the comparator is provided using template arguments for SGLSort.

SGLSort::sort has a time complexity of O(n ln(n))

end being before start results in undefined behaviour.

If start and end are from different data structures, this function will cause undefined behaviour.

©2025 05524F.sg (Singapore)

contact 05524F / report a bug / make a suggestion

about 05524F SINGAPORE values

list of 05524F projects