#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
#include <futures.h>
#include <futures_static_thread_pool.h>
#include <atomic>
#include <functional>
#include <memory>
#include <thread>
#include <utility>
#include <folly/experimental/pushmi/examples/pool.h>
#include <folly/experimental/pushmi/o/just.h>
#include <folly/experimental/pushmi/o/transform.h>
#include <folly/experimental/pushmi/o/via.h>
#include <folly/experimental/pushmi/strand.h>
Go to the source code of this file.
|
template<class T , class Executor > |
std::pair< std::experimental::standard_promise< T >, std::experimental::standard_future< T, std::decay_t< Executor > > > | p1054::make_promise_contract (const Executor &e) |
|
template<class Executor , class Function , class Future > |
std::experimental::standard_future< std::result_of_t< Function(std::decay_t< typename std::decay_t< Future >::value_type > &&)>, std::decay_t< Executor > > | p1054::then_execute (Executor &&e, Function &&f, Future &&pred) |
|
template<class Executor , class Function , class Future > |
auto | p1055::then_execute (Executor &&e, Function &&f, Future &&pred) |
|
int | main () |
|
Definition at line 113 of file then_execute_2.cpp.
References f, folly::pushmi::operators::just, max, folly::gen::move, p1054::then_execute(), p1055::then_execute(), and v.
116 std::experimental::futures_static_thread_pool sp{
117 std::max(1u, std::thread::hardware_concurrency())};
120 auto& pr = std::get<0>(
pc);
121 auto& r = std::get<1>(
pc);
123 sp.executor(), [](
int v) {
return v * 2; },
std::move(r));
135 std::cout <<
"OK" << std::endl;
constexpr detail::Map< Move > move
std::experimental::standard_future< std::result_of_t< Function(std::decay_t< typename std::decay_t< Future >::value_type > &&)>, std::decay_t< Executor > > then_execute(Executor &&e, Function &&f, Future &&pred)
auto then_execute(Executor &&e, Function &&f, Future &&pred)
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::operators::just_fn just