Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
sfinae 远离析构函数
我正在实施一些非常类似于std vector但使用堆栈上的数组而不是内存分配 d tor 调用使用 SFINAE 的函数 If value typePOD 函数体为空 If value type是正常的班级这样std string 该函数有
c
c14
constexpr
sfinae
void_t 在 Visual Studio 2015 上失败
我不明白为什么 Visual Studio 2015 的以下测试总是失败 static assert 触发器 include
c
visualstudio2015
c14
sfinae
SFINAE 无法有条件地编译成员函数模板
我正在尝试你使用std enable if使用 SFINAE 和以下代码有条件地仅选择两个成员函数模板中的一个 include
c
C11
templates
visualc
sfinae
我们如何修改检测工具包来检查一个类是否具有具有特定签名的成员函数?
鉴于 减少 实施检测惯用语 http www open std org jtc1 sc22 wg21 docs papers 2015 n4502 pdf namespace type traits template
c
templates
c14
sfinae
typetraits
SFINAE decltype 逗号运算符技巧
读完马蒂厄的回答后here https stackoverflow com a 9531274 955273 我决定自己尝试一下 我的尝试无法编译 因为 SFINAE 没有启动并剔除has foo尝试访问的函数T foo error str
c
C11
sfinae
编写专门用于类及其子类的函数模板
我正在尝试编写一个函数模板 一个版本应该用于不满足另一版本标准的所有类型 当参数是给定类的基类或该类本身时 应使用另一个版本 我尝试过超载Base 但是当类派生自Base 他们使用通用的 而不是特定的 我也尝试过这种 SFINAE 方法 s
c
templates
sfinae
SFINAE 中使用的别名模板导致硬错误
我想使用启用程序 别名模板enable if 在一个类模板中定义 在另一个类模板中定义 它看起来像这样 template lt gt using enabler typename std enable if lt gt type 这对于 S
c
typedef
sfinae
typetraits
classtemplate
SFINAE 如何使用省略号?
过去 当使用 SFINAE 选择构造函数重载时 我通常使用以下内容 template
c
C11
variadictemplates
sfinae
编译器如何确定使用 SFINAE 的函数和标准函数(如果两者都可行)?
考虑以下代码 include
c
C11
sfinae
sfinae 与 decltype:clang 或 gcc 中的错误?
Clang 3 2 可以编译并且代码的行为符合预期 struct have f int f int i return 10 struct empty template
c
gcc
C11
Clang
sfinae
为什么 SFINAE (enable_if) 在类定义内部起作用,但在外部不起作用
过去几个小时我一直在努力解决这个非常奇怪的问题 在解决了 SFINAE 的 5 6 个其他问题之后 因为我是新手 基本上在下面的代码中我想要f 适用于所有可能的模板实例化 但有g 仅当N 2 include
c
templates
sfinae
enableif
partialspecialization
在编译时检测 typedef(模板元编程)
我目前正在做一些模板元编程 就我而言 我可以处理任何 可迭代 类型 即任何类型typedef foo const iterator以同样的方式存在 我试图为此使用新的 C 11 模板元编程 但是我找不到检测某种类型是否丢失的方法 因为我还需
c
C11
sfinae
templatemetaprogramming
typetraits
将枚举值与 SFINAE 结合使用
我已经熟悉 SFINAE 以及如何使用它来根据传递的类型启用特定模板 通过使用 std enable if 不过 我最近开始从事一个项目 我想在该项目中执行以下操作 在使用 SFINAE 时根据提供的枚举值创建一个类专业化 现在 我知道考虑
c
templates
sfinae
类型推导后函数模板中的替换顺序是否有保证?
考虑这个函数模板 template
c
templates
C11
overloading
sfinae
通过模板参数中的 SFINAE 选择构造函数
我试图通过 SFINAE 选择一个构造函数 如下所示 template
c
templates
c14
sfinae
如何判断一个类是否有成员变量?
Problem 我想检测一个类是否有成员变量 如果有 则静态断言失败 就像是 struct b int a static assert has member variables b Class should not contain memb
c
templates
sfinae
SFINAE 内部概念模板参数
SFINAE 在概念论证中起作用吗 也许这里不叫SFINAE 例子 template
c
sfinae
C20
cconcepts
C++ SFINAE 未失败
Code include
c
templates
sfinae
C++ SFINAE:const char[] 与 std::string 的 is_constructible
我正在尝试禁用具有非 std string 可构造类型的 ctor 我的第一次尝试是这样的 include
c
templates
sfinae
使用 SFINAE 检测成员函数 [重复]
这个问题在这里已经有答案了 C 11中 判断一个类是否有成员函数size 您可以定义以下测试助手 template
c
sfinae
c98
1
2
3
4
5
6
»