I want to pass a bunch of lambdas around without having to make copies.
This is the declaration of one of the lambdas
[
promise = std::move(promise),
namedSeries = std::move(namedSeries)
] mutable
Since promise and namedSeries are rValues, the lambda is not copy constructible, so it can not be passed to a function with parameter type std::function.
For a work-around, I can wrap the lambda parameters in pointers, but that is extra boilerplate.
Is there a better solution? Perhaps a function type that does not require the lambda to be copy-constructible?
4