Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
std::async 可以调用 std::function 对象吗?
是否可以使用 std async 调用使用 std bind 创建的函数对象 以下代码无法编译 include
c
C11
stdfunction
stdasync
您是否需要存储 std::async 的 std::future 返回值?
考虑以下代码 include
c
C11
stdasync
C++ 中的可调用类对象:没有匹配的函数可用于调用“std::tuple
::tuple(
)”
我的代码由 2 个文件组成 main cpp and utils hpp 这些文件的内容如下 实用程序 hpp ifndef UTILITY HPP define UTILITY HPP include
c
C17
stdasync
完美转发到异步 lambda
我有一个函数模板 我想在其中完美转发到在另一个线程上运行的 lambda 这是一个可以直接编译的最小测试用例 include
c
C11
Lambda
perfectforwarding
stdasync
为什么 std::future 与 std::packaged_task 和 std::async 返回的不同?
我知道了原因future从返回std async有一些特殊的共享状态wait on returned future发生在 future 的析构函数中 但是当我们使用std pakaged task 其未来不会表现出相同的行为 要完成打包任务
c
c14
stdasync
packagedtask
stdfuture
使用 x64 时 C++ 异步返回值不同
以下代码使用 Debug Win32 和 Debug 进行编译x64在VC2013中设置 但是当我使用Debug时 x64我得到以下信息智能感知错误 IntelliSense no operator matches these operan
c
VisualStudio
visualstudio2013
64bit
stdasync
哪些 std::async 实现使用线程池?
使用的优点之一std async而不是手动创建std thread对象应该是std async可以在幕后使用线程池来避免超额订阅问题 但是哪些实现可以做到这一点呢 我的理解是微软的实现确实如此 但是其他的呢 async实施 Gnu 的 li
c
Multithreading
C11
stdasync
从 std::async 返回的 std::future 在超出范围时挂起
我正在使用以下组合std async and std future from C 11 我用来对我在代码中执行的某个活动强制执行 time outmight我尝试连接到服务器时需要一些时间 代码如下 include
c
C11
stdasync
stdfuture
错误:命名空间“std”中没有名为“async”的成员
我知道std async是 C 11 的事情 但我很确定我的编译器支持 C 11 include
MacOS
C11
Clang
stdasync
stdfuture
我可以使用 std::async 而不等待未来的限制吗?
高水平我想在异步模式下调用一些没有返回值的函数 而不等待它们完成 如果我使用 std async 则未来对象在任务结束之前不会破坏 这使得调用在我的情况下不同步 Example void sendMail const std string
c
Multithreading
C11
Asynchronous
stdasync