diff --git a/emper/Fiber.hpp b/emper/Fiber.hpp index 741c1bd1657da5795a8d8eec6e2c18352baca79a..c7b47d6a7e4b10f6d8d55ed42a1ca1c9e743698a 100644 --- a/emper/Fiber.hpp +++ b/emper/Fiber.hpp @@ -57,17 +57,17 @@ class ALIGN_TO_CACHE_LINE Fiber : public AbstractFiber, public Logger<LogSubsyst Fiber() : Fiber([]() {}) {} protected: - Fiber(fiber_fun_t function, void* arg, workeraffinity_t* affinity) - : function(std::move(function)), arg(arg), affinity(affinity){}; + Fiber(fiber_fun_t function, void* arg, workeraffinity_t* affinity) noexcept + : function(std::move_if_noexcept(function)), arg(arg), affinity(affinity) {}; // cppcheck-suppress uninitMemberVar - explicit Fiber(const fiber_fun0_t& function, workeraffinity_t* affinity) + explicit Fiber(const fiber_fun0_t& function, workeraffinity_t* affinity) noexcept : Fiber([function](UNUSED_ARG void* arg) { function(); }, nullptr, affinity) {} - Fiber(fiber_fun_t function, void* arg) : Fiber(std::move(function), arg, nullptr){}; + Fiber(fiber_fun_t function, void* arg) noexcept : Fiber(std::move(function), arg, nullptr){}; // cppcheck-suppress uninitMemberVar - explicit Fiber(const fiber_fun0_t& function) : Fiber(function, nullptr) {} + explicit Fiber(const fiber_fun0_t& function) noexcept : Fiber(function, nullptr) {} virtual ~Fiber() = default;