Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
为什么大括号初始化器的自动类型推导和模板类型推导不同?
我明白 给定一个支撑初始化器 auto将推导出一个类型std initializer list 而模板类型推导将会失败 auto var 1 2 3 type deduced as std initializer list
c
C11
templates
templateargumentdeduction
listinitialization
为什么不能从 Template
::Type 推导出 T? [复制]
这个问题在这里已经有答案了 这段代码有什么问题 include
c
templates
parameters
templateargumentdeduction
使用 lambda 作为函数指针时,模板参数推导/替换失败
我想知道为什么在下面的代码中编译器无法使用 lambda 作为函数 foo 的参数 模板参数推导 替换失败 而一个简单的函数却可以工作 template
c
templates
Lambda
templateargumentdeduction
函数模板参数在模板参数显式传递时丢失 const?
template
c
templateargumentdeduction
我可以为`std`命名空间添加推导指南吗?
假设我想制作一个新的演绎指南 使以下内容成为可能 std string str std basic string view sv str 这是一个好的定制吗 命名空间 std 2 4 https timsong cpp github io
c
languagelawyer
cfaq
deductionguide
templateargumentdeduction
缩写函数模板与带有转发引用参数的函数模板
两者有什么区别带有转发参考参数的函数模板 template
c
templates
c14
typededuction
templateargumentdeduction
可变参数推导指南不是由 g++ 采取的,而是由 clang++ 采取的 - 谁是正确的?
考虑以下代码 template
c
templates
variadictemplates
C17
templateargumentdeduction
如何为通用 lambda 参数定义模板参数? [复制]
这个问题在这里已经有答案了 解释 当我编写 lambda 作为以 lambda 作为参数的泛型函数的参数时 CLion 及其标准编译器给我一个错误 即 候选模板被忽略 该 lambda 采用泛型类型T并返回另一个未知类型A 我正在编写的容器
c
templates
Lambda
C17
templateargumentdeduction
std::array 的推导指南
我浏览了 C 模板独特指南 一书 并尝试了解其中的推导指南std array作品 关于标准的定义 声明如下 template
c
templates
C17
variadictemplates
templateargumentdeduction
从模板函数返回 double 或complex
我正在编写一些函数模板来重载 矩阵类的运算符 我对类型矩阵做了很多工作double and complex
c
templates
templateargumentdeduction
将引用作为参数的模板参数推导
我正在尝试深刻理解模板论证推导 我不明白的一点是 我应该如何应用标准中的规则here对于类型A and P对于以下情况 遗憾的是 cppreference com 上没有示例 请参阅下面的相关部分 template
c
templates
C17
templateargumentdeduction
如何在 C++20 中创建模板别名的推导指南?
假设我有一个类 结构模板及其构造函数的显式推导指南 让这个类有两个模板参数 其中一个可以通过推导指南推导 另一个则不能 template
c
templates
C20
templateargumentdeduction
deductionguide
为什么模板参数不推导只作为返回类型?
如果我不在函数参数列表中使用模板参数 类型 gt 仅作为返回类型 则不会有任何推论 template
c
templates
languagelawyer
templateargumentdeduction
获取函数参数类型作为元组
Problem 给定任何函数 或可调用 类型Function 如何将其所有参数类型作为元组类型获取 例如 我需要一个特质function traits
c
templates
C17
variadictemplates
templateargumentdeduction
使用未扩展的参数包作为模板模板参数的非类型模板参数的类型是否合法? [复制]
这个问题在这里已经有答案了 gcc 和 clang 对于以下代码是否应该编译存在分歧 template
c
C17
languagelawyer
variadictemplates
templateargumentdeduction
新表达式的模板参数推导失败
我正在开发一个可变参数类模板 但如果不指定模板参数 我就无法将它与新表达式一起使用 我不想 我将问题简化为以下代码示例 template
c
C17
templateargumentdeduction
使用显式命名空间限定符时模板实例化行为会发生变化吗?
我一直在试验可组合管道系统 该系统涉及一组可以模板化的 阶段 每个阶段处理自己的设置 执行和清理 并且模板推导用于构建管道使用的最小 状态 列表 这需要相当多的样板模板代码 这已经显示出一些明显不协调的行为 尽管实验成功 但实际上将其滚动到
c
templates
languagelawyer
instantiation
templateargumentdeduction
«
1
2