Make the Policy local variable a reference in main.cpp, remove a useless #include directive and include Yerbacon.hpp before future.

This commit is contained in:
Username404 2021-08-06 11:37:47 +02:00
parent c2a9c630ed
commit 604532dc34
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 3 deletions

View File

@ -1,12 +1,11 @@
#include <iostream>
#include <experimental/array>
#include <set>
#include "headers/Yerbacon.hpp"
#include <future>
#include <sstream>
using namespace std;
#include "headers/misc.hpp"
#include "headers/Yerbacon.hpp"
#include "headers/arguments.hpp"
#include "headers/transpiler/Target.hpp"
@ -34,9 +33,9 @@ int main(int argc, char* argv[]) {
if (!files.empty()) {
const set<string_view> uniqueFiles(files.begin(), files.end());
vector<future<string>> Units;
const launch& Policy = not parallel ? launch::deferred : launch::async;
for (string_view fileName: uniqueFiles) {
if (fileName != "none") {
const launch Policy = !parallel ? launch::deferred : launch::async;
future<string> newAsync = async(Policy, [printResult, fileName, target]() mutable {
const string transpiledString = transpile(parseString(getFileContent(fileName.data())), target);
stringstream consoleOutput;