mirror of
https://github.com/boostorg/coroutine.git
synced 2026-01-31 08:02:18 +00:00
coroutine: intro of coroutine<>::pull_type, coroutine<>::push_type
[SVN r85058]
This commit is contained in:
@@ -50,10 +50,10 @@ std::pair< node::ptr_t, node::ptr_t > create_diff_trees()
|
||||
}
|
||||
|
||||
#ifdef BOOST_COROUTINES_UNIDIRECT
|
||||
bool match_trees( boost::coroutines::pull_coroutine< leaf & > & c1,
|
||||
boost::coroutines::pull_coroutine< leaf & > & c2)
|
||||
bool match_trees( boost::coroutines::coroutine< leaf & >::pull_type & c1,
|
||||
boost::coroutines::coroutine< leaf & >::pull_type & c2)
|
||||
{
|
||||
typedef boost::range_iterator< boost::coroutines::pull_coroutine< leaf & > >::type iterator_t;
|
||||
typedef boost::range_iterator< boost::coroutines::coroutine< leaf & >::pull_type >::type iterator_t;
|
||||
iterator_t i1( boost::begin( c1) );
|
||||
iterator_t e1( boost::end( c1) );
|
||||
iterator_t i2( boost::begin( c2) );
|
||||
@@ -64,15 +64,15 @@ int main()
|
||||
{
|
||||
{
|
||||
std::pair< node::ptr_t, node::ptr_t > pt = create_eq_trees();
|
||||
boost::coroutines::pull_coroutine< leaf & > te1( boost::bind( enumerate_leafs, _1, pt.first) );
|
||||
boost::coroutines::pull_coroutine< leaf & > te2( boost::bind( enumerate_leafs, _1, pt.second) );
|
||||
boost::coroutines::coroutine< leaf & >::pull_type te1( boost::bind( enumerate_leafs, _1, pt.first) );
|
||||
boost::coroutines::coroutine< leaf & >::pull_type te2( boost::bind( enumerate_leafs, _1, pt.second) );
|
||||
bool result = match_trees( te1, te2);
|
||||
std::cout << std::boolalpha << "eq. trees matched == " << result << std::endl;
|
||||
}
|
||||
{
|
||||
std::pair< node::ptr_t, node::ptr_t > pt = create_diff_trees();
|
||||
boost::coroutines::pull_coroutine< leaf & > te1( boost::bind( enumerate_leafs, _1, pt.first) );
|
||||
boost::coroutines::pull_coroutine< leaf & > te2( boost::bind( enumerate_leafs, _1, pt.second) );
|
||||
boost::coroutines::coroutine< leaf & >::pull_type te1( boost::bind( enumerate_leafs, _1, pt.first) );
|
||||
boost::coroutines::coroutine< leaf & >::pull_type te2( boost::bind( enumerate_leafs, _1, pt.second) );
|
||||
bool result = match_trees( te1, te2);
|
||||
std::cout << std::boolalpha << "diff. trees matched == " << result << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user