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