xhawk18 / promise-cpp

C++ promise/A+ library in Javascript style.
MIT License
672 stars 92 forks source link

无法从“initializer list”转换为“const std::initializer_list<promise::Defer>” #11

Open winsoft666 opened 3 years ago

winsoft666 commented 3 years ago

我使用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<promise::Defer> &)”: 无法将参数 1 从“initializer list”转换为“const std::initializer_list<promise::Defer> &”
1>d:\sourcecode\Github\promise-cpp\promise.hpp(1416,1): message : 原因如下: 无法从“initializer list”转换为“const std::initializer_list<promise::Defer>”
1>d:\sourcecode\Github\promise-cpp\promise.hpp(1416,16): message : 元素“1”: 没有从“std::vector<promise::Defer,std::allocator<promise::Defer>>”到“promise::Defer”的转换
1>d:\sourcecode\Github\promise-cpp\promise.hpp(1370,14): message : 参见“promise::all”的声明
1>d:\sourcecode\Github\promise-cpp\test\test0.cpp(115): message : 查看对正在编译的函数 模板 实例化“promise::Defer promise::all<std::vector<promise::Defer,std::allocator<promise::Defer>>>(std::vector<promise::Defer,std::allocator<promise::Defer>>)”的引用
xhawk18 commented 3 years ago

已修正,多谢指出 https://github.com/xhawk18/promise-cpp/commit/f8db3ad10091e4d1a951c0c52f35f0338374cdc0

chausner commented 3 years ago

@xhawk18 If you create a new release of this library which includes this fix, I can add this library to vcpkg.

xhawk18 commented 3 years ago

@xhawk18 If you create a new release of this library which includes this fix, I can add this library to vcpkg.

thank you, created new release here https://github.com/xhawk18/promise-cpp/releases/tag/1.0.3