danvratil / qcoro

C++ Coroutines for Qt
https://qcoro.dvratil.cz
MIT License
331 stars 53 forks source link

Make QCoro::Generator<T> properly move-constructible #151

Closed vicr123 closed 1 year ago

vicr123 commented 1 year ago

QCoro::Generator<T> is currently not properly move-constructible, as the move constructor holds a reference to the existing std::coroutine_handle, destroying it when the original generator is destroyed.

This PR creates a custom move constructor for QCoro::Generator<T> in order to properly move-construct it.

danvratil commented 1 year ago

Thanks a lot for the patch (and sorry for the delayed review!)