Freigeben über


nth_element (STL/CLR)

 

The latest version of this topic can be found at nth_element (STL/CLR).

Partitions a range of elements, correctly locating the nth element of the sequence in the range so that all the elements in front of it are less than or equal to it and all the elements that follow it in the sequence are greater than or equal to it.

Syntax

template<class _RanIt> inline  
    void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last);  
template<class _RanIt, class _Pr> inline  
    void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last,  
        _Pr _Pred);  

Remarks

This function behaves the same as the STL function nth_element. For more information, see nth_element.

Requirements

Header: <cliext/algorithm>

Namespace: cliext

See Also

algorithm (STL/CLR)