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

Function parallel_sort

example/cpp14/parallel_group/parallel_sort.cpp:76–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 typename RandomAccessIterator,
75 BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) CompletionToken>
76auto parallel_sort(
77 Executor executor,
78 RandomAccessIterator begin,
79 RandomAccessIterator end,
80 CompletionToken&& token)
81{
82 return boost::asio::async_compose<CompletionToken, void()>(
83 [=](auto& self, auto... args)
84 {
85 if (sizeof...(args) == 0)
86 {
87 using self_type = std::decay_t<decltype(self)>;
88 parallel_sort_impl(executor, begin, end,
89 [self = std::make_shared<self_type>(std::move(self))]
90 {
91 boost::asio::dispatch(
92 boost::asio::append(
93 std::move(*self), 0));
94 }
95 );
96 }
97 else
98 {
99 self.complete();
100 }
101 },
102 token
103 );
104}
105
106int main()
107{

Callers 2

parallel_sort_implFunction · 0.85
mainFunction · 0.85

Calls 3

parallel_sort_implFunction · 0.85
dispatchFunction · 0.50
completeMethod · 0.45

Tested by

no test coverage detected