-/* Copyright (c) 2015-2021. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
}
void operator()() const
{
- const int argc = args_->size();
std::vector<std::string> args = *args_;
std::vector<char*> argv(args.size() + 1); // argv[argc] is nullptr
std::transform(begin(args), end(args), begin(argv), [](std::string& s) { return &s.front(); });
- code_(argc, argv.data());
+ code_(static_cast<int>(args.size()), argv.data());
}
};
}
private:
- template <class F> typename std::enable_if_t<canSBO<F>()> init(F code)
+ template <class F> typename std::enable_if_t<canSBO<F>()> init(F task_code)
{
const static TaskVtable vtable {
// Call:
src_code->~F();
}
};
- new(&buffer_) F(std::move(code));
+ new (&buffer_) F(std::move(task_code));
vtable_ = &vtable;
}
- template <class F> typename std::enable_if_t<not canSBO<F>()> init(F code)
+ template <class F> typename std::enable_if_t<not canSBO<F>()> init(F task_code)
{
const static TaskVtable vtable {
// Call:
// Move:
nullptr
};
- *reinterpret_cast<F**>(&buffer_) = new F(std::move(code));
+ *reinterpret_cast<F**>(&buffer_) = new F(std::move(task_code));
vtable_ = &vtable;
}