diff --git a/src/main.cpp b/src/main.cpp index 3935f57..d7c63fd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,7 +44,7 @@ int main(int argc, char* argv[]) { const launch& Policy = not parallel ? launch::deferred : launch::async; for (const string_view& fileName: uniqueFiles) { if (fileName != "none") { - Units.push_back(async(Policy, [fileName, &compile]() { + Units.push_back(async(Policy, [&fileName, &compile]() { try { return pair(compile(fileName), optional()); } catch (const Yerbacon::Exception& e) { @@ -66,7 +66,7 @@ int main(int argc, char* argv[]) { } } if (printResult) cout << "~~~~[Yerbacon compilation result]~~~~\n\n"; - for (auto& currentFuture: Units) { + for (future>>& currentFuture: Units) { const auto&& result = currentFuture.get(); if (not result.second.has_value()) { if (printResult) cout << result.first << "\n\n";