You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll cram everything I find while modifying your async_generator implementation to meet my personal needs in here. Numbers, so that it's easier to answer, if you choose to do so. Hope this helps.
Is your code licensed or licensable?
Shouldn't the move op also destroy the coroutine since the async_generator owns it?
async_generator& operator=(async_generator&& other) {
// _Coro was renamed to handle_ in my code.if (&other != this) {
if (handle_) {
handle_.destroy();
}
handle_ = std::exchange(other.handle_, nullptr);
}
}
You're not using the await_iterator::owner boolean anymore.
Inheriting from std::iterator is deprecated, if I'm not mistaken.
using iterator_category = std::input_iterator_tag;
using difference_type = std::ptrdiff_t;
using value_type = T;
using pointer = T*; // I needed an iterator instead of a const_iteratorusing reference = T&;
According to VS 15.4.2 warnings, from_promise taking a pointer is deprecated and accepts the promise by reference.
P.S.: Your code helped me a lot. Thank you! :)
The text was updated successfully, but these errors were encountered:
qis
changed the title
async_generator move op
Small issues.
Nov 5, 2017
I'll cram everything I find while modifying your
async_generator
implementation to meet my personal needs in here. Numbers, so that it's easier to answer, if you choose to do so. Hope this helps.Is your code licensed or licensable?
Shouldn't the move op also destroy the coroutine since the
async_generator
owns it?You're not using the
await_iterator::owner
boolean anymore.Inheriting from
std::iterator
is deprecated, if I'm not mistaken.from_promise
taking a pointer is deprecated and accepts the promise by reference.P.S.: Your code helped me a lot. Thank you! :)
The text was updated successfully, but these errors were encountered: