Add a "unit_result" type alias to main.cpp
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
de2d936e19
commit
7cbb424416
|
@ -57,12 +57,13 @@ int main(int argc, char* argv[]) {
|
|||
};
|
||||
int8_t exit_code = EXIT_SUCCESS;
|
||||
if (!files.empty()) {
|
||||
using unit = future<pair<string, optional<Yerbacon::Exception>>>;
|
||||
using unit_result = pair<string, optional<Yerbacon::Exception>>;
|
||||
using unit = future<unit_result>;
|
||||
vector<unit> Units(files.size());
|
||||
const launch& Policy = not parallel ? launch::deferred : launch::async;
|
||||
transform(files.cbegin(), files.cend(), Units.begin(), [&Policy, &compile](const string_view& fileName){
|
||||
return async(Policy, [&fileName, &compile]() {
|
||||
pair<string, optional<Yerbacon::Exception>> resultingPair;
|
||||
unit_result resultingPair;
|
||||
try {
|
||||
resultingPair.first = compile(fileName);
|
||||
} catch (const Yerbacon::Exception& error) {
|
||||
|
|
Loading…
Reference in New Issue