Simple WhenAll examples.
Simple WhenAll examples
#include <chrono>
#include <iostream>
#include <type_traits>
#include <utility>
#include <vector>
#include <gtest/gtest.h>
namespace {
using namespace std::chrono_literals;
std::vector<yaclib::FutureOn<int>> futs;
futs.reserve(5);
for (int i = 0; i < 5; ++i) {
return i;
}));
}
std::vector<int> ints = std::move(all).Get().Ok();
std::cout << "All ints: ";
for (auto v : ints) {
std::cout << v << ", ";
}
std::cout << std::endl;
tp.Stop();
tp.Wait();
}
}
}
TODO(kononovk) Doxygen docs.
Provides a mechanism to access the result of async operations.
auto Run(Func &&f)
Execute Callable func on Inline executor.
TEST(Example, HelloWorld)