sincerely Singaporean

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

SGLMoreThan

see header file

(no source file, everything inside header)

template ‹typename T› class SGLMoreThan;

part of SGEXTN module SG_Containers

descending comparator struct for use with SGEXTN Containers

detailed description

list of all including inherited members

implementation details

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

CMake target for BuildLah: SGEXTN::SG_Containers

see this link for more information about BuildLah

parent class: (none)

children classes: (none)

instance member functions

[[nodiscard]] bool operator()(const T& a, const T& b) const;

Detailed Description

SGLMoreThan provides a descending comparator struct for use with SGEXTN Containers, this can be used when using SGLPriorityQueue, SGLSet, SGLMultiSet, or SGLMap. You need operator› defined to use SGLMoreThan with custom structs. SGLLesserThan works with any object pointers. This is a template based class with no separate source file.

Implementation Details

SGLMoreThan calls operator› on the corresponding data type if it is a custom struct. For object pointers, direct comparison is undefined behaviour if they are not allocated in the same C array creation call, so SGLMoreThan converts them to bytes first and compares the bytes.

[[nodiscard]] bool operator()(const T& a, const T& b) const;

Returns if a is more than b.

This is internally used by SGLPriorityQueue, SGLSet, SGLMultiSet, and SGLMap when SGLMoreThan is selected as the comparator struct.

The presense of operator() makes SGLMoreThan a functor.

This will not compile if operator› is not defined for T. Check the source code of any SGEXTN struct (SGXChar, SGXString, SGXColourRGBA, SGXColourHSLA, SGXIdentifier, SGXTimeStamp, SGXVector2) to see how to define operator›.

©2025 05524F.sg (Singapore)

contact 05524F / report a bug / make a suggestion

about 05524F SINGAPORE values

list of 05524F projects