Skip to content

Commit

Permalink
Merge pull request #43 from hp-peti/pull_coroutine_std_begin_end_patch
Browse files Browse the repository at this point in the history
Fix ambiguity of std::begin/end
  • Loading branch information
olk authored Oct 2, 2021
2 parents a0d56e9 + 37f08bb commit bf12f18
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions include/boost/coroutine2/detail/pull_coroutine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ class pull_coroutine {
};

friend class iterator;

iterator begin() { return iterator (this); }
iterator end() { return iterator(); }
};

template< typename T >
Expand Down Expand Up @@ -238,6 +241,9 @@ class pull_coroutine< T & > {
};

friend class iterator;

iterator begin() { return iterator (this); }
iterator end() { return iterator(); }
};

template<>
Expand Down Expand Up @@ -278,6 +284,8 @@ class pull_coroutine< void > {
explicit operator bool() const noexcept;

bool operator!() const noexcept;


};

template< typename T >
Expand All @@ -294,22 +302,6 @@ end( pull_coroutine< T > &) {

}}}

namespace std {

template< typename T >
typename boost::coroutines2::detail::pull_coroutine< T >::iterator
begin( boost::coroutines2::detail::pull_coroutine< T > & c) {
return boost::coroutines2::detail::begin( c);
}

template< typename T >
typename boost::coroutines2::detail::pull_coroutine< T >::iterator
end( boost::coroutines2::detail::pull_coroutine< T > & c) {
return boost::coroutines2::detail::end( c);
}

}

#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
Expand Down

0 comments on commit bf12f18

Please sign in to comment.