腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
搜索
关闭
文章
问答
(5736)
视频
开发者手册
清单
用户
专栏
沙龙
全部问答
原创问答
Stack Exchange问答
更多筛选
回答情况:
全部
有回答
回答已采纳
提问时间:
不限
一周内
一月内
三月内
一年内
问题标签:
未找到与 相关的标签
筛选
重置
5
回答
decltype
vs auto
据我所知,
decltype
和auto都会尝试找出某种东西的类型。如果我们定义: return 34;那么这两个声明都是合法的:cout << x << endl; cout << y << endl; 你能告诉我
decltype
和auto的主要区别是什么吗?
浏览 4
修改于2016-02-21
得票数 63
回答已采纳
1
回答
使用
decltype
时出错
我是C++的初学者,正在尝试使用
decltype
。在这段代码中,使用1就可以了。x将是一个整数*。但是,我对使用2.取消引用(*)指针应该提供int有疑问。但它似乎是int &参考。我对此感到困惑。#include<iostream> {
decltype
(p) x; //use 1
decltype
(*p) x; /
浏览 0
提问于2017-12-11
得票数 0
2
回答
decltype
的行为
我可以这样定义相同类型的其他对象:但我不能以这种方式为容器声明迭代器:为什么
浏览 3
修改于2015-02-11
得票数 11
回答已采纳
1
回答
模板参数和
decltype
template<typename T> template<typename C> static char test(
decltype
浏览 23
提问于2020-12-08
得票数 1
1
回答
成员函数的
decltype
template <typename Getter> typedef
decltype
(mygetter.get()) gotten_t;}; 当然,问题是我在定义
浏览 1
修改于2012-04-14
得票数 6
回答已采纳
3
回答
decltype
和圆括号
(§7.6.1.2/4)第148页上示例的最后一行:int i;const A* a = new A();
decltype
(i) x2; // type is int
decltype
(a->x)x3; /
浏览 5
修改于2014-06-09
得票数 53
回答已采纳
2
回答
&
decltype
(Obj)::成员不工作
bind(&
decltype
(obj)::f, obj, __VA_ARGS__) { return bll::bindm(Adder(5), foo, bll::_1)
浏览 0
提问于2012-12-11
得票数 4
回答已采纳
1
回答
Decltype
Bug Gcc无法编译
decltype
没有向HTestSet返回正确的类型。你知道为什么它没有返回正确的值类型吗?function for call to 'HTestSet(TestClass&, void (BaseClass::*)(int), int&)' if(HTestSet(OBGEC_ON, &
decltype
浏览 1
提问于2018-08-31
得票数 1
2
回答
decltype
,result_of,还是typeof?
class Ev { typedef result_of(T::toCPD()) D;meta.h:12:错误:'T::toCPD‘不是类型
decltype
浏览 1
修改于2010-05-04
得票数 12
回答已采纳
2
回答
SFINAE和
decltype
(自动)
如果函数模板返回
decltype
(auto) (或使用auto的另一个类型说明符),但返回语句的格式不正确,是否会导致SFINAE?return语句是否被视为函数签名的直接上下文?此外,在没有
decltype
(auto)的情况下无法检查对等非静态成员函数的存在,因为this不能在函数签名中使用。然而,这表明了一个基本问题,因为
decltype
(auto)提供了一条路径,可以将成员签名中的类类型视为完整的,而实际上却不是。 建议已经写好了吗,或者问题已经被正式分析过了吗?
浏览 2
修改于2013-07-12
得票数 19
回答已采纳
1
回答
返回函数的
Decltype
decltype
(*T()) operator*() { }我给
decltype
一个调用T类的运算符*,它甚至可以工作,但是如果T没有默认的构造函数,它就不能工作。
浏览 1
修改于2012-09-29
得票数 10
回答已采纳
2
回答
decltype
on type表达式
template<class T1, class T2> static T2 T2_ (); };typedef
decltype
(T1+T2) sum_type; 但这是不可能的,因为T1和T2是类型,而不是变量。
浏览 0
提问于2012-11-17
得票数 3
回答已采纳
1
回答
使用
decltype
作为模板参数
int, float, bool>; template<typename To> using ResolveReturnConvertType =
decltype
浏览 1
提问于2016-02-24
得票数 0
1
回答
decltype
(*&fun)是不是很奇怪?
include <stdio.h> { std::is_same<
decltype
(*&f),
decltype
(f)>::value, std::is_function<
decltype
(
浏览 2
修改于2012-03-03
得票数 4
2
回答
为什么不向C++引入autoval/autoref或
decltype
_val/
decltype
_ref?
int or int &
decltype
((i)); //???我想知道我们能不能借用一下“覆盖”的概念?例如:
decltype
_val(i+j); //we need a value 如果我们需要一个值或引用,我们只是明确地向编译器展示我们的想法
浏览 2
修改于2016-04-22
得票数 0
回答已采纳
5
回答
auto与
decltype
的关系
是等同于或
decltype
((initializer)) x = initializer
浏览 0
修改于2015-08-15
得票数 35
回答已采纳
1
回答
带有模板参数的
Decltype
test1.cpp -o test1 -std=c++11class Handlepublic:#include <iostream> class Handlepublic:
浏览 0
修改于2016-01-12
得票数 6
回答已采纳
2
回答
可选成员的
Decltype
char *word) return Result{ 1,2 };}; 我希望能够做这样的事情: int main() Dict abc;
decltype
浏览 14
修改于2019-02-06
得票数 3
回答已采纳
3
回答
decltype
(函数)作为类成员
我有:
decltype
(foo) operator(); Bar bar6));这会导致稍微令人吃惊的编译器错误消息(g++ 4.6.1):将成员名称更改为
decltype
浏览 0
修改于2012-02-17
得票数 6
回答已采纳
2
回答
使用auto,
decltype
,=,[]声明函数
我在以下文件中找到了一个这样定义的函数: 这似乎只适用于自动和解密类型。using namespace std; {}; int f = [](int a, int b) //DOES NOT WORK return a * b;*/ { cout<<f(a,b)
浏览 4
提问于2015-09-21
得票数 2
回答已采纳
第 2 页
第 3 页
第 4 页
第 5 页
第 6 页
第 7 页
第 8 页
第 9 页
第 10 页
第 11 页
点击加载更多
领券