GithubHelp home page GithubHelp logo

jbandela / stackless_coroutine Goto Github PK

View Code? Open in Web Editor NEW
334.0 26.0 37.0 358 KB

Use C++14 generic lambdas to simulate stackless coroutines without macros or type erasure.

Home Page: http://stackless-coroutine.readthedocs.io/en/latest/index.html

License: Boost Software License 1.0

CMake 0.40% C++ 99.60%

stackless_coroutine's People

Contributors

jbandela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stackless_coroutine's Issues

Error template in gcc 4.9

Hello,

Congratulations for your stackless implementation, is very nice and interesting for me. I have a problem when compile in gcc 4.9 (works in clang 3.6):

/home/travis/build/makiolo/asyncply/stackless_coroutine/stackless_coroutine.hpp:223:16: error: template declaration of ‘constexpr const bool stackless_coroutine::detail::has_finished_storage_v’ (Travis source)

Thanks. Ricardo.

operator() on function objects need to be const (VS2017)

Not sure if this library is still being worked on but I wanted to use some function objects that stored some state that mutated as the co-routine looped. However operator() has to be const or else I get the error
error C3848: expression having type 'const signal_cv' would lose some const-volatile qualifiers in order to call 'auto signal_cv::operator ()<DC,Value>(Context &,Vars &)

The code reads:

template<typename Context, typename Vars>
auto operator()(Context &c, Vars &v)
{
cv.notify_all();
return c.do_next();
}

I can get around it with mutable members but I was just wondering if I've missed something, it's as designed or a VS issue?

Thanks

Recommended way to mix do_async and do_next

I'm writing a function object that needs to check a state variable when it starts and if a condition is met simply continue on the pipeline. If the condition is false I need to issue an async operation (ASIO). Because I'm using async I need to return context.do_async(), however this means the return value in an auto operator() is different than earlier where it was context.do_next().

Is there a way to handle these cases elegantly?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.