{"id":24918467,"url":"https://github.com/brendan0powers/cpppromise","last_synced_at":"2025-04-09T16:53:21.671Z","repository":{"id":142195287,"uuid":"91278772","full_name":"brendan0powers/CppPromise","owner":"brendan0powers","description":"An implementation of A+ promises in C++","archived":false,"fork":false,"pushed_at":"2017-05-14T23:59:43.000Z","size":6,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T19:04:02.598Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brendan0powers.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":"2017-05-14T23:56:03.000Z","updated_at":"2020-11-13T05:04:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"895fdeb0-c491-4143-b7fb-0a937e36e7bb","html_url":"https://github.com/brendan0powers/CppPromise","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendan0powers%2FCppPromise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendan0powers%2FCppPromise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendan0powers%2FCppPromise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendan0powers%2FCppPromise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brendan0powers","download_url":"https://codeload.github.com/brendan0powers/CppPromise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248073668,"owners_count":21043473,"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":[],"created_at":"2025-02-02T09:31:53.121Z","updated_at":"2025-04-09T16:53:21.665Z","avatar_url":"https://github.com/brendan0powers.png","language":"C++","readme":"CppPromise is an experimental implementation of the JavaScript [A+](https://promisesaplus.com/) Promise standard in C++. It is designed to make asynchornous code easier to write and maintain. There are several other implementations of this concept already ([cpp-promise](https://github.com/xhawk18/promise-cpp), [q](https://github.com/grantila/q), [PoolQueue](https://github.com/rhashimoto/poolqueue)). CppPromise is mostly an excuse for me to improve my tempalte meta-programming skills. However, it may have some features that make it useful to others.\n\n* __Header only__\n* __Works on early C++11 compilers__ - (VS2013 in particular)\n* __Type-safe__ - Promise objects are strongly typed, and most mistakes should be caught at compile time.\n* __Framework agnostic__ - Does not have a bundled event system or timers. Feel free to use any framewok that makes sense (Boost.Asio, libuv, Qt, etc...)\n\nCppPromise is __extermly experimental__ at the moment. There is currently no documentation, almost no comments, and no tests.\n\nHere is a code example\n```C++\n    //Return an already resolved promise containing an int\n    Promise\u003cint\u003e testReturnInt()\n    {\n        return resolve(123);\n    }\n\n    //Return an already resolved promise containing a float\n    Promise\u003cfloat\u003e testReturnFloat()\n    {\n        return resolve(1.23f);\n    }\n\n    testReturnInt().then([](int iTest) {\n       REQUIRE(iTest == 123);\n       return testReturnFloat();\n    }).then([](float fTest) {\n        REQUIRE(fTest == Approx(1.23));\n        testReturnInt();\n    }).fail([](std::exception \u0026e) {\n        std::cout \u003c\u003c \"Exception was thrown: \" \u003c\u003c e.what() \u003c\u003c std::endl;\n    });\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrendan0powers%2Fcpppromise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrendan0powers%2Fcpppromise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrendan0powers%2Fcpppromise/lists"}