EnTT 4.0.0
Loading...
Searching...
No Matches
entt::std_sort Struct Reference

Function object to wrap stl::sort in a class type. More...

#include <algorithm.hpp>

Public Member Functions

template<typename Compare = stl::less<>, typename... Args>
void operator() (stl::random_access_iterator auto first, stl::random_access_iterator auto last, Compare compare=Compare{}, Args &&...args) const
 Sorts the elements in a range.

Detailed Description

Function object to wrap stl::sort in a class type.

Unfortunately, stl::sort cannot be passed as template argument to a class template or a function template.
This class fills the gap by wrapping some flavors of stl::sort in a function object.

Definition at line 22 of file algorithm.hpp.

Member Function Documentation

◆ operator()()

template<typename Compare = stl::less<>, typename... Args>
void entt::std_sort::operator() ( stl::random_access_iterator auto first,
stl::random_access_iterator auto last,
Compare compare = Compare{},
Args &&... args ) const
inline

Sorts the elements in a range.

Sorts the elements in a range using the given binary comparison function.

Template Parameters
CompareType of comparison function object.
ArgsTypes of arguments to forward to the sort function.
Parameters
firstAn iterator to the first element of the range to sort.
lastAn iterator past the last element of the range to sort.
compareA valid comparison function object.
argsArguments to forward to the sort function, if any.

Definition at line 36 of file algorithm.hpp.


The documentation for this struct was generated from the following file: