{"id":16890870,"url":"https://github.com/grisumbras/corots","last_synced_at":"2025-03-20T07:46:33.141Z","repository":{"id":83306769,"uuid":"148975808","full_name":"grisumbras/corots","owner":"grisumbras","description":"An attempt to implement Coroutines TS (N4760) as a library on top of resumable expressions (P0114R0)","archived":false,"fork":false,"pushed_at":"2018-09-18T11:11:49.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-25T09:12:36.400Z","etag":null,"topics":["coroutines","cpp","cxx"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grisumbras.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-16T08:07:00.000Z","updated_at":"2018-09-17T14:06:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"b58fe712-9a55-4582-ba4f-0f77d84ff1b0","html_url":"https://github.com/grisumbras/corots","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"c9e8d28fc7da1289d6f9cc8a2bb88115d078931c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grisumbras%2Fcorots","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grisumbras%2Fcorots/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grisumbras%2Fcorots/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grisumbras%2Fcorots/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grisumbras","download_url":"https://codeload.github.com/grisumbras/corots/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244574798,"owners_count":20474818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coroutines","cpp","cxx"],"created_at":"2024-10-13T17:04:46.781Z","updated_at":"2025-03-20T07:46:33.120Z","avatar_url":"https://github.com/grisumbras.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# corots\n\n\u003e An attempt to implement Coroutines TS (N4760) as a library on top of\n\u003e resumable expressions (P0114R0) with some modifications.\n\n## Usage\n\nFirst, note, that it doesn't actually work, because both resumable object and\n`break resumable` (the core functionality of resumable expressions) are\ncurrently stubs. I am planning on integrating Chris Kohlhoff's prototype\n(that uses stackfull coroutines from Boost) into this project.\n\nOther than that, there had to be some changes in usage with regards to TS,\nbecause it relies on some code transformations, and a library-only solution\ncannot do that.\n\n\nWhere with TS you'd write\n\n```c++\ngenerator\u003cint\u003e my_generator() {\n    co_yield 1;\n}\n\nint main() {\n    for (auto n: my_generator()) {\n        std::cout \u003c\u003c n;\n    }\n}\n```\n\nwith this library you'd write\n```c++\n#include \u003ccorots/coroutine.hpp\u003e\n\nauto constexpr m_generator = corots::coroutine\u003cgenerator\u003cint\u003e\u003e(\n    [](auto\u0026 promise){\n        corots::yield(promise, 1);\n    }\n);\n\nint main() {\n    for (auto n: my_generator()) {\n        std::cout \u003c\u003c n;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrisumbras%2Fcorots","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrisumbras%2Fcorots","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrisumbras%2Fcorots/lists"}