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
The documentation says that std::begin and std::end are overloaded for coroutine<>::pull_type, but the following example code fails to compile on Clang (Xcode 11.4, macOS 10.15.4):
usingnamespaceboost::coroutines2;auto my_coro = coroutine<int>::pull_type{
[](coroutine<int>::push_type& yield) {
for (int i = 0; i < 5; ++i) {
yield(i);
}
}
};
for (auto i = std::begin(my_coro); i != std::end(my_coro); ++i) {
// ^ No matching function for call to 'begin', No matching function for call to 'end'
std::cout << *i << std::endl;
}
Calling detail::begin and detail::end directly works, and range-based for also works.
I'm not sure if this is a bug, a documentation problem, or a misunderstanding at my end.
The text was updated successfully, but these errors were encountered:
The documentation says that
std::begin
andstd::end
are overloaded forcoroutine<>::pull_type
, but the following example code fails to compile on Clang (Xcode 11.4, macOS 10.15.4):Calling
detail::begin
anddetail::end
directly works, and range-basedfor
also works.I'm not sure if this is a bug, a documentation problem, or a misunderstanding at my end.
The text was updated successfully, but these errors were encountered: