MCPcopy Create free account
hub / github.com/OpenNMT/CTranslate2 / wait_on_futures

Function wait_on_futures

python/cpp/utils.h:100–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99 template <typename Result>
100 std::vector<Result> wait_on_futures(std::vector<std::future<Result>> futures) {
101 std::vector<Result> results;
102 results.reserve(futures.size());
103 for (auto& future : futures)
104 results.emplace_back(future.get());
105 return results;
106 }
107
108 template <typename Result>
109 std::variant<std::vector<Result>, std::vector<AsyncResult<Result>>>

Callers 3

detect_languageMethod · 0.85
alignMethod · 0.85
maybe_wait_on_futuresFunction · 0.85

Calls 2

sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected