腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
2
回答
std
::
async
参数
太多
、
、
、
好的,我试图在一个项目中使用
std
::future,但是我使用的
std
::
async
总是告诉我有
太多
的
参数
。::future<int> FN1 =
std
::
async
(
std
::launch::
async
, F, 1, 2, 3);
std
::future<int> FN2 =
std
::
async
(
std
::launch::<e
浏览 67
提问于2020-03-19
得票数 1
回答已采纳
2
回答
具有可变模板的C++异步无法找到正确的函数模板专门化
、
、
、
我有一个带有成员函数f的类,我用可变模板和forward将它包装起来,使另一个成员函数成为rf (只需在f的末尾添加一个特定的
参数
,以做一些不同的事情)。然后,我通过用
async
包装rf来创建另一个成员函数
async
_rf,但它不起作用。我尝试通过使用额外的特定
参数
包装f来生成
async
_rf,并且它可以工作。
async
(&test::rf, this,
std
::forward<Args>(args)...); /
浏览 0
提问于2015-06-29
得票数 1
1
回答
使用
std
::bind来捕获“移动”
参数
包
、
、
、
、
我正试图从头开始实现
std
::
async
,并遇到了一个带有只移动类型
参数
的问题。我已经找到了一个解决方案,使用
std
::bind“通过移动”捕获
参数
包,然后使用包装器将
参数
从绑定对象的存储中移出到我真正想要调用的函数的
参数
槽中。如果你不想
太多
的话,它甚至看起来很优雅。我的
std
::bind是防弹的吗?也就是说,有人能给出一个示例,说明STL的
std
::
async
工作而我的
Async
浏览 1
提问于2015-07-22
得票数 1
3
回答
为什么‘`
std
::异步’不能选择正确的重载?
、
、
请考虑以下例子:#include <future> {
std
::size_t result = lim_ * 10;} {
std
浏览 4
提问于2020-02-03
得票数 2
回答已采纳
1
回答
包装rvalue引用lambda时
std
::异步和
std
::bind的区别
、
、
、
、
受此启发,将rvalue引用
参数
直接绑定到
std
::
async
,通过
std
::
async
编译和执行将rvalue绑定到lambda:()
std
::cout << message <<
std
::endl;auto future =
std
::
async
(lambda,
浏览 2
提问于2015-05-06
得票数 8
回答已采纳
1
回答
使用
std
::
async
编辑数组
、
、
bool flag; : value(1) {} { arrData.resize(10);
std
::vector<
std
::future<void>> results;
std
::for_each(arrData.b
浏览 4
提问于2017-07-30
得票数 1
回答已采纳
2
回答
std
::异步
参数
的生存期是多少?
、
、
、
通过
std
::
async
执行的函数的
参数
似乎共享未来的生存期:#include <future>{)&s <<
std
::endl; }; auto fut =
std
::
async
(
std
::launch:
浏览 0
提问于2018-03-27
得票数 6
回答已采纳
1
回答
std
::
async
与
std
::launch::
async
策略的行为
、
、
我对异步返回的
std
::launch::
async
策略和
std
::future对象的
std
::
async
函数的行为有一些疑问。
std
::this_thread::sleep_for(
std
::chrono::seconds(10));
std
::cout << "foo:done" <<
浏览 16
提问于2012-03-16
得票数 17
回答已采纳
1
回答
std
::异步返回值。未知误差
、
、
我尝试使用
std
::异步,因为我需要该方法的返回值。我已经搜索了我得到的错误,不知道是怎么回事。::thread compare(timeNext(start),
std
::move(xNext)); { auto f1 =
std
::
async
浏览 1
提问于2013-09-26
得票数 0
回答已采纳
1
回答
来自windows xp中
std
::
async
的
std
::
async
、
、
#include <iostream>#include <thread> int main() auto f1=
async
(launch::
async
, []()->int {
浏览 0
提问于2018-10-10
得票数 2
3
回答
Can
std
::异步“重用”线程?
、
、
正如在标题中所描述的,我想知道使用
std
::
async
运行的任务是否可以“重用”空闲线程。例如,让我们使用下一段代码:int tasksCount= 160; for (int i = 0; i < tasksCount;
浏览 0
提问于2018-01-31
得票数 0
回答已采纳
1
回答
使用
std
::累积,获得“
太多
参数
”错误
、
std
::accumulate应该能够接受三个或四个
参数
。在前一种情况下,只是想在容器中添加数字;在后一种情况下,您需要首先应用一个函数,然后再添加它们。我编写了代码,生成一个随机加倍向量,然后对它们执行一些操作:首先,它使用
std
::transform执行x->x^2转换,然后将它们与
std
::accumulate相加,最后使用
std
::accumulate的四
参数
版本将这两个动作组合成一个动作。看看在上找到的示例代码,我看不出有什么理由不应该这样做,但是在编译时我得到了一个“<
浏览 3
提问于2013-01-20
得票数 2
1
回答
是否可以按顺序执行"cout“?
、
、
、
是否可以按照所示的顺序(从下到上)获得原始输出? cout<<R"(programming )";sleep(10); cout<<R"( i'm )"; sleep(1); newbie at------->printed s
浏览 15
提问于2020-11-25
得票数 0
回答已采纳
1
回答
std
::merge不适用于
std
::异步
、
int main() vector<int> a(100); vector<int> c(200); b.end(), c.begin>::type>
std
:
浏览 2
提问于2016-12-16
得票数 5
回答已采纳
2
回答
带有可变模板的C++误差
、
、
我有以下代码,使用各种模板调用
std
::异步,{ bool checkBlock::future< bool > tk(
std
::
async
(
std
::launch, fn, this, } struct TestChild: pub
浏览 0
提问于2018-11-05
得票数 2
回答已采纳
3
回答
通过引用将
参数
传递给
std
::
async
失败
、
、
、
我注意到不可能将非常数引用作为
参数
传递给
std
::
async
。include <functional> int value = 23;}error: no type named ‘type’ in ‘class
std</em
浏览 4
提问于2013-08-21
得票数 31
回答已采纳
2
回答
std
::异步-
std
::
std
::
std
::
std
::deferred
、
、
我理解
std
::
async
如何处理以下
参数
。
std
::launch::asyncstd::launch::deferred 但是发生了什么,
std
::launch::
async
|
std
::launch::deferred
浏览 4
提问于2012-02-20
得票数 8
回答已采纳
2
回答
模板函数启动类成员函数,其中包含
std
::异步。
、
class test_f { int f(int m) { return 1Args>
Async
(F&& f, T&& t, Args&&
浏览 1
提问于2016-10-06
得票数 3
回答已采纳
1
回答
C++11异步仅使用一个核心。
、
、
、
::ceil((int)(NThreads / PathCountLength));
std
::cout << "HERE" <<
std
::endl; unsigned __::
浏览 3
提问于2015-02-23
得票数 6
1
回答
使用
Async
/Futures并行并行计算向量的范数
、
、
recursiveTwoNorm(const Vector& x, unsigned long levels){ unsigned long end = x.numRows();
std
::future<double> partial =
std
::
async
(
std
::launch::deferred, rtn_worker,
std
::ref(x), 0, end-1, levels*我已经使用thread.h实现了这一点,但我想将
浏览 1
提问于2017-05-11
得票数 1
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
【Rust日报】2021-01-16 Async-std v1.9.0 发布
【大家的项目】socks5-rs 一个使用async-std的异步socks5 server实现
基于C++从0到1手写Linux高性能网络编程框架[掌握基于GO的HTTP框架设计]
【Rust每周一库】smol-异步rumtime
STD10NF10T4场效应管:技术规格参数、工作原理与应用电路全解析
热门
标签
更多标签
云服务器
ICP备案
对象存储
腾讯会议
云直播
活动推荐
运营活动
广告
关闭
领券