MCPcopy Create free account
hub / github.com/boostorg/asio / fork_join_sort

Function fork_join_sort

example/cpp14/executors/fork_join.cpp:246–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244
245template <class Iterator>
246void fork_join_sort(Iterator begin, Iterator end)
247{
248 std::size_t n = end - begin;
249 if (n > 32768)
250 {
251 {
252 fork_executor fork(pool);
253 join_guard join(fork);
254 fork.execute([=]{ fork_join_sort(begin, begin + n / 2); });
255 fork.execute([=]{ fork_join_sort(begin + n / 2, end); });
256 }
257 std::inplace_merge(begin, begin + n / 2, end);
258 }
259 else
260 {
261 std::sort(begin, end);
262 }
263}
264
265int main(int argc, char* argv[])
266{

Callers 1

mainFunction · 0.70

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected