Commit f8eb4a2d authored by Tiago Peixoto's avatar Tiago Peixoto

Fix compatibility with coroutine for boost < 1.62

parent 69810889
Pipeline #391 passed with stage
in 305 minutes and 20 seconds
......@@ -30,12 +30,28 @@
{
namespace coroutines = boost::coroutines2;
}
template <class Coro, class Dispatch>
auto make_coro(Dispatch&& dispatch)
{
return std::make_shared<Coro>
(graph_tool::coroutines::fixedsize_stack(BOOST_COROUTINE_STACK_SIZE),
dispatch);
}
# else
# include <boost/coroutine/all.hpp>
namespace graph_tool
{
namespace coroutines = boost::coroutines;
}
template <class Coro, class Dispatch>
auto make_coro(Dispatch&& dispatch)
{
return std::make_shared<Coro>
(dispatch,
graph_tool::coroutines::attributes(BOOST_COROUTINE_STACK_SIZE));
}
# endif
#endif // HAVE_BOOST_COROUTINE
......
......@@ -90,9 +90,7 @@ class CoroGenerator
public:
template <class Dispatch>
CoroGenerator(Dispatch& dispatch)
: _coro(std::make_shared<coro_t::pull_type>
(coroutines::fixedsize_stack(BOOST_COROUTINE_STACK_SIZE),
dispatch)),
: _coro(make_coro<coro_t::pull_type>(dispatch)),
_iter(begin(*_coro)), _end(end(*_coro)), _first(true) {}
boost::python::object next()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment