promise-cpp icon indicating copy to clipboard operation
promise-cpp copied to clipboard

C++ promise/A+ library in Javascript style.

Results 14 promise-cpp issues
Sort by recently updated
recently updated
newest added

The following does not work using clang 14 ```c++ auto promise = newPromise([](Defer d){ /*...*/ }); promise.then([bla]() mutable { }); ``` with "call_traits.hpp:135:20: error: call to pointer to member function...

Hi, I'm trying to use promise-cpp in multi-threaded programs, but sometimes the following assertion error occurs in promise-cpp. promise_inl.hpp(161) ```cpp std::list &pendingTasks = promiseHolder->pendingTasks_; //promiseHolder->dump(); assert(pendingTasks.front() == task); // Assertion...

bug

``` struct Test { Test() { printf("constructor\n"); }; Test(const Test &) { printf("copy constructor\n"); } Test(Test && m) { printf("move constructor\n"); } ~Test() { printf("destruct \n"); } }; int main()...

test0.cpp中有如下示例 ``` .then([&next](){ output_func_name(); next= newPromise([](Defer d) { output_func_name(); //尝试调用d.resolve(1, 'c'); }); //尝试调用 next.resolve();,或next.resolve(1, 'c'); //Will call next.resole() or next.reject() later //throw 33; //next.reject(55, 66); return next; }) ``` 如果增加`next.resolve();`或者`d.resolve();`...

Thank you for bringing this promise concept to C++ land! This library is super-useful for event loop driven programming! :) Consider this: ```cpp promise::Defer p = promise::resolve(); p.then([]() { std::cout

我使用VS2019编译test0工程,提示如下错误: ``` 1>------ 已启动生成: 项目: test0, 配置: Debug Win32 ------ 1>test0.cpp 1>d:\sourcecode\Github\promise-cpp\promise.hpp(1416,1): error C2664: “promise::Defer promise::all(const std::initializer_list &)”: 无法将参数 1 从“initializer list”转换为“const std::initializer_list &” 1>d:\sourcecode\Github\promise-cpp\promise.hpp(1416,1): message : 原因如下: 无法从“initializer list”转换为“const...

如题,是否可以让promise默认在子线程中运行

有没有例子? js里面是给then的参数是数组[value1, value2] const makeRequest = () => { return promise1() .then(value1 => { return Promise.all([value1, promise2(value1)]); }) .then(([value1, value2]) => { return promise3(value1, value2); }); };

PM_MULTITHREAD is enabled. pm_memory_pool::~pm_memory_pool crashes because node == NULL when thread exit. part of program ``` C++ Defer GetCredentials() { return newPromise([](Defer d){ TestWindow *fWnd = new TestWindow(d, BRect(0, 0,...

Hello, I'm owner of [rili project](https://gitlab.com/rili/rili). It also implements promise/defered pattern for c++. Maybe you would like to contribute it? I suppose together we can create something really good ;)