Visible to Intel only — GUID: GUID-FA79F4F3-8230-44D0-A150-85BFF221124A
Visible to Intel only — GUID: GUID-FA79F4F3-8230-44D0-A150-85BFF221124A
parallel_sort ranges interface extension
Description
oneAPI Threading Building Blocks (oneTBB) implementation extends the oneapi::tbb::parallel_sort specification with overloads that takes the container by forwarding reference.
API
Header
#include <oneapi/tbb/parallel_sort.h>
Syntax
namespace oneapi {
namespace tbb {
template <typename Container>
void parallel_sort( Container&& c );
template <typename Container, typename Compare>
void parallel_sort( Container&& c, const Compare& comp );
} // namespace tbb
} // namespace oneapi
Functions
template<typenameContainer>voidparallel_sort(Container&&c);
Equivalent to parallel_sort( std::begin(c), std::end(c), comp ), where comp uses operator< to determine relative orderings.
template<typenameContainer,typenameCompare>voidparallel_sort(Container&&c, constCompare&comp);
Equivalent to parallel_sort( std::begin(c), std::end(c), comp ).
Example
This interface may be used for sorting rvalue or constant views:
#include <array>
#include <span> // requires C++20
#include <oneapi/tbb/parallel_sort.h>
std::span<int> get_span() {
static std::array<int, 3> arr = {3, 2, 1};
return std::span<int>(arr);
}
int main() {
tbb::parallel_sort(get_span());
}