Closed fosterbrereton closed 1 year ago
Well, actually std::move() casts _f to an r-value and then returns the result of the call to _f();
Was this triggered with one of our tests, or because of a special callable that you have passed to it?
I do not want to exclude that we have a bug here. I would like to understand why we did not find this with our tests.
You know, I had hit a compilation issue when working on a class that depended on this code, and adding mutable
made the compiler happy. I have since removed these changes and recompiled the code to try and find a specific unit test that I could add. But the error has disappeared. You can disregard this PR for now, but if it happens again, I'll let you know.
The implementation of
future::then(E&& executor, F&& f)
constructs a lambda that is not mutable, but then callsstd::move(_f)
. On Xcode 13.4.1, this causes a compilation error because the lambda isconst
. Making the lambdamutable
resolves the issue.