腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
正确
使用
invoke_result的方式?
、
、
、
在上,
使用
std
::result_of的
正确
方法是:
std
::
result_of_t
<F&&(Args&&...)> // instead of
std
::
result_of_t
<F(Args...)>, which is wrongmy_invoke(F&& f, Args&&...
浏览 5
提问于2017-12-18
得票数 10
回答已采纳
0
回答
正确
使用
std
::
result_of_t
、
、
; // (1) using T1 = decltype(f()); using T3 =
result_of_t
<F&&()>; static_assert那么,decltype(f(
浏览 1
提问于2016-07-12
得票数 5
回答已采纳
2
回答
将lambda作为参数注入到模板方法中
、
、
、
::
result_of_t
<Function()>, typename = typename
std
::enable_if<
std
::is_same<Return, void>::value>::
result_of_t
<Function()>, typename = typename
std
::enable_if<!::
result_of_t
<Function()>, typename = typename <e
浏览 1
提问于2018-01-31
得票数 2
1
回答
C++模板
result_of_t
在试图查找函数的返回值时没有名为“type”的类型
、
、
、
我看到的一个解决方案是
使用
result_of_t
#include <vector>#include <type_traits::
result_of_t
<decltype(func1_internal<num_t>)>; //using ResultType =
std
::
result_of_t
<decltype(func1_= type
浏览 19
提问于2022-03-25
得票数 0
回答已采纳
2
回答
用于lvalue/rvalue参数的
std
::result_of
、
我在玩时注意到了
std
::result_of的这种行为: int operator()(const int&) const { ... }};
result_of_t
<Foo(int&&)> b;// char
re
浏览 5
提问于2016-06-15
得票数 1
回答已采纳
2
回答
具有cv限定参数的成员对象的result_of
、
、
、
有几个人建议了不用result_of就能得到
正确
结果的替代方法。我应该澄清一下,我之所以对result_of的
正确
定义挂起脑筋,是因为我实际上正在实现与预C++11编译器工作的result_of最接近的合理实现。因此,虽然我同意可以在decltype或result_of<Mp(const MyClass&&)>::type中
使用
C++11,但它们并不能满足我对C++03的需求。有几个人给出了
正确
的答案,即函数的const rvalue参数不是函数类型的一部分。这为我澄清了一些事情,我将实现我的预
浏览 4
提问于2016-08-28
得票数 20
回答已采纳
1
回答
result_of没有为mem_fn定义类型
、
、
、
functional> int get() const& { }
std
::
result_of_t
<Func(X)> Apply(Func fn) { return fn(x); Apply([](X::_Mem_fn<int (X::*)() const &>]: no type named &
浏览 6
提问于2017-02-08
得票数 9
回答已采纳
1
回答
传递到
std
::result_of之前的衰变类型
、
、
、
Args> async( Function::cout <<
std
::boolalpha <<
std
::is_same<int,
std
::
result_of_t</em
浏览 2
提问于2016-06-15
得票数 10
回答已采纳
1
回答
将packaged_task对象移动到lambda捕获时出错
、
、
、
然而,在
使用
lambda技巧将打包的任务移动到函数对象时,我遇到了错误。 // ...::
std
::deque <::
std
::function<void()>> _work_queue; ::
std
::condition_variable_worker_signal; template <typename Callab
浏览 2
提问于2016-05-01
得票数 8
2
回答
VC2017错误匹配模板类参数
、
、
我在VS2013中
使用
了一个VS2013模板函数,没有任何问题。但是当我升级到VS2017时,VC编译器会抱怨它不能匹配参数列表。有人能帮我解决密码吗?ARGS> typename
std
::enable_if<
std
::is_same<bool,
std
::
result_of_t
<CALLABLE(ARGS&&...)>>::value,
std
::
result_of_t
<CALLABLE(ARGS&a
浏览 0
提问于2019-04-10
得票数 1
回答已采纳
1
回答
std
::result_of参数类型
、
、
假设我们有一个人为设计的函数:
std
::
result_of_t
<
std
::decay_t<F>(???)> transform(F&& f) static const int num = 42;}template<ty
浏览 0
提问于2016-06-20
得票数 0
1
回答
可调用结果类型的推导
、
、
、
class Aauto make_A( callable f ) return A<callable, typename
std
::
result_of_t
<callable> >{ f };{}error: implicit instantiation of undefined template '<
浏览 2
提问于2016-10-26
得票数 5
回答已采纳
2
回答
查找类型是否可调用
、
、
is_callable constexpr static const bool val = false;struct is_callable<T,
std
::
result_of_t
<T()>> constexpr static const bool val = true;constexpr bool= []() {return 3.0; }; auto intIsFunc = is_func&l
浏览 0
提问于2018-09-26
得票数 1
回答已采纳
3
回答
在编译时生成类型为T的序列
、
、
N_i>{ using callable_out_type =
std
::
result_of_t
< callable( /* T , ... , T <- sizeof..
浏览 11
提问于2016-10-26
得票数 9
回答已采纳
3
回答
C++14中用于lambda的
std
::result_of的限制
、
{} {
std
::invoke_result_t<decltype(fun_provider),
std
::string> >(fun_provider("Provided
浏览 33
提问于2021-10-04
得票数 4
回答已采纳
3
回答
确定
std
::函数的返回类型
、
、
我正在编写一个接收
std
::function对象的模板函数(通过
使用
适当的参数调用
std
::bind生成)。在这个函数中,我想确定这个函数对象的返回类型。是可能的吗?
浏览 0
提问于2015-06-10
得票数 6
回答已采纳
1
回答
变量模板函数没有匹配的函数调用
、
代码如下 #include <iostream>template<class F, class ...Args> cout<<sizeof...Args>
std
::
result_of_t
<F> foo(F&&, Arg
浏览 21
提问于2020-09-11
得票数 2
回答已采纳
2
回答
默认类型的C++函数引用模板替换错误
、
、
考虑以下片段:#include <string>
std
::string stringify (const Treturn "dummy"; } class foo_classpublic:
浏览 5
提问于2016-10-12
得票数 0
回答已采纳
3
回答
C++元函数,该函数确定提供的参数是否可调用类型
、
、
、
Args>{
std
::cout << "test 1 (should be 1) = " << result <<
std
::endl;
浏览 3
提问于2016-11-29
得票数 6
回答已采纳
1
回答
获取类定义中可调用的输入/输出类型
、
、
、
template< typename T_in = /*input type of _f */, typename T_out = /*output type of _f */ > {
std
::vector<T_out> res( input.size()A<Func> A_wra
浏览 1
提问于2016-10-18
得票数 1
回答已采纳
点击加载更多
相关
资讯
正确使用“微信”
如何正确使用DeepSeek?
C+标准库 std:thread 的简单使用,一文搞定还不简单?
MongoDB的正确使用姿势
请正确使用公共WiFi
热门
标签
更多标签
云服务器
ICP备案
实时音视频
云直播
对象存储
活动推荐
运营活动
广告
关闭
领券