Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
如何正确使用通过转发引用传递的可调用对象?
我习惯将 lambda 函数 和其他可调用函数 传递给模板函数并使用它们 如下所示 template
c
languagelawyer
C17
decltype
perfectforwarding
decltype(some_vector)::size_type 不能用作模板参数
以下类无法编译 template
c
C11
templates
vector
decltype
decltype中的成员函数调用
以下代码 struct A int f int auto g int x gt decltype f x 无法编译并出现错误 error cannot call member function int B f int without obj
c
C11
decltype
memberfunctions
如何获取类中函数的返回类型?
例如 class A int foo return 1 void goo decltype A nullptr gt foo i The decltype A nullptr gt foo 在这里不起作用 因为 A 是不完整的类 怎么做 关
c
class
C11
decltype
VS2013 Intellisense 不理解 decltype
是否有补丁 官方或非官方 可以让 IntelliSense 停止报告每次使用decltype作为语法错误 它编译得很好 所以我知道decltype是支持的 但是到处都是红色波浪线会让人分心 而且很难找到actual代码中的错误 每次编译都会
c
visualstudio2013
IntelliSense
decltype
使用 decltype 作为成员函数返回类型时,声明顺序很重要
为什么这有效 template
C11
decltype
如何从自动返回类型推导出类型? [复制]
这个问题在这里已经有答案了 这个答案 https stackoverflow com a 11774533 476681有这样的代码片段 template
c
C11
AUTO
decltype
returntypededuction
派生类中的 sizeof(*this) 和 decltype(*this)
假设有类 struct A int a virtual size t GetMemoryUsage const return sizeof this struct B public A int b 而且可能还有更深层次的传承 我想要的是有一
c
C11
inheritance
sizeof
decltype
为什么私有成员变量不允许使用 decltype?
假设我有一个这样的类 class Foo std vector
c
C11
decltype
decltype(auto) 和 decltype(returning expr) 作为返回类型有什么区别?
有什么区别decltype auto and decltype returning expression 作为函数 模板 的返回类型如果expr在这两种情况下都没有使用括号吗 auto f gt decltype auto return e
c
c14
AUTO
decltype
void_t 和带有 decltype 的尾随返回类型:它们完全可以互换吗?
考虑以下基于的基本示例void t template
c
templates
sfinae
decltype
C17
类成员变量的decltype,是否被禁止?为什么?
我可以写 int a decltype a b 但是我的编译器 Microsoft Visual Studio 2010 cl版本 16 00 40219 01 禁止我 class A int a decltype a b error C2
c
C11
decltype
使用 SFINAE 检测相同的类继承
我正在尝试编写一个元函数来检查作为可变参数模板参数传递的所有类型是否不同 似乎执行此操作的最有效方法是从一组类继承并检测是否存在错误 问题是下面的代码编译失败 而我希望 SFINAE 能够工作 Edit 问题不是 如何编写该元函数 而是 如
c
C11
templatemetaprogramming
sfinae
decltype
decltype(void()) 中的 void() 是表达式还是函数类型?
这是后续的this https stackoverflow com questions 39278200 is sizeofvoid a legal expression问题 更准确地说是评论this https stackoverflow
c
C11
languagelawyer
void
decltype
对于自动返回类型,使用哪种更好: decltype 或 std::common_type<>::type (如果可能)?
作为对我的回答最后一个问题 https stackoverflow com questions 11052842 error with using decltype in c11 creating opaque error message
c
C11
typetraits
decltype
尾随返回类型中的占位符是否会覆盖初始占位符?
g 似乎接受任意组合auto and decltype auto 作为初始和尾随返回类型 int a auto f return a int auto g gt auto return a int auto h gt decltype au
c
decltype
c14
trailingreturntype
returntypededuction
通过索引访问可变参数模板中的类型
我想通过索引获取可变参数模板中的类型 索引被指定为模板参数 我设法找到了一个有效的 黑客 但我相信它不符合可变参数模板编程的精神 此外 它还使用额外的内存 这是带有一些解释的代码 template
c
C11
variadictemplates
decltype
boostany
decltype(*&fun) 很奇怪吗?
I have include
c
g
C11
decltype
decltype((c)) 中括号的含义? [复制]
这个问题在这里已经有答案了 我正在读书维基百科上的这篇文章关于C 11 类型推断 feature http en wikipedia org wiki C 11 Type inference 有一个例子 我引用一下 include
c
C11
decltype
sfinae 位于类体外部定义的成员函数上
有点像我的延续上一个问题 https stackoverflow com questions 11694970 c11 style sfinae and function visibility on template instantiati
c
templates
C11
sfinae
decltype
1
2
3
»