Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
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
是否可以根据模板类型参数的嵌套 typedef 的存在来专门化模板定义?
我有一个模板 template
c
templates
templatespecialization
sfinae
如何检测类中是否存在特定的成员变量?
为了创建算法模板函数 我需要知道作为模板参数的类中的 x 或 X 以及 y 或 Y 当我将我的函数用于 MFC CPoint 类或 GDI PointF 类或其他一些类时 它可能很有用 他们都在其中使用不同的 x 我的解决方案可以简化为以下
c
VisualStudio
templates
g
sfinae
SFINAE 模板专业化优先级
include
c
templates
sfinae
templatespecialization
如何使用 std::enable_if 约束类模板和数据成员
我有一个类模板 template
c
C11
sfinae
enableif
SFINAE 用于测试另一个命名空间中的自由函数
我试图想出一个 hack 来测试是否std isnan在预处理器中没有特殊大小写编译器的情况下定义 并提出了以下内容 我希望它能正常工作 include
c
sfinae
断言代码无法编译
简而言之 如何编写一个测试 检查我的类不可复制或可复制分配 而只能移动和移动分配 一般来说 如何编写测试 确保特定代码does not编译 像这样 Movable but non copyable class struct A A cons
c
C11
boost
compilererrors
sfinae
1
2
3
4
5
»