Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
为什么 C++ Concepts TS 中同时存在变量和函数概念?
我一直在看 C 1zN4377 http www open std org jtc1 sc22 wg21 docs papers 2015 n4377 pdfGCC 6 中正在实现的概念 TS 草案 我不明白拥有两种不同概念的目的 变量概念
c
cconcepts
CTS
C++ 部分概念 id:显式模板规范顺序/第一个参数的特殊状态的原因是什么?
我开始尝试概念的 C 20 功能 当我意识到可以部分显式地为概念提供模板参数时 我感到非常高兴 我读了 cppreference 文章 但没有找到那里提到的内容 但后来我意识到一些奇怪的事情 模板参数的指定顺序与我的预期相反 当提供一个显式
c
standards
C20
cconcepts
SFINAE 内部概念模板参数
SFINAE 在概念论证中起作用吗 也许这里不叫SFINAE 例子 template
c
sfinae
C20
cconcepts
GCC:'std::is_same_v
' 在常量表达式中不可用
尝试实施下面的代码 https godbolt org z zPMae4 template
c
C20
typetraits
cconcepts
为什么使用无效概念被视为格式错误
新公布的草案中提到 expr prim req 6 https eel is c draft expr prim req 6 sentence 6 如果将模板参数替换为要求会 总是导致替换失败 程序格式错误 不 需要诊断 Example t
c
templates
C20
cconcepts
requiresexpression
受约束的成员函数和显式模板实例化
G 和 Clang 一致认为以下代码片段不是有效的 C template
c
languagelawyer
C20
cconcepts
explicitinstantiation
什么是 C++ 技术规范?
Concepts lite C 提案 N3701 功能未包含在 C 1y 标准中 但据说它将作为技术规范发布 它究竟意味着什么 它会自动成为下一个 C 版本的标准功能吗 我通常不喜欢复制粘贴答案 但我认为它解释得很好here http is
c
c14
cconcepts
C++ 概念:检查是否派生自具有未知模板参数的模板化类
有没有一种方法可以使用 C 概念来要求类派生自模板类 而模板类的模板参数又是另一个模板类的派生类 Example template
c
C20
cconcepts
如何使用自定义错误消息使概念失败 (C++20)
概念非常适合查明代码行的错误 未满足约束条件 然而 我想知道是否可以在那里发布自定义信息消息 static assert 的优点正是这种可能性 用例 任何想要帮助用户弄清楚为什么某个表达式不满足约束的库 这是一个简单的例子 只是为了有一些代
c
templates
compilererrors
C20
cconcepts
使用概念或 SFINAE 检查类是否具有带 std::array 参数的模板化成员函数
介绍 我想使用概念和 或类型特征来检测类是否具有带有 std array 参数的成员函数 例如 下面的课程将传递这个概念 class OStreamRealizationGood template
c
Arrays
metaprogramming
typetraits
cconcepts
我如何告诉编译器 MyCustomType 与 SomeOtherType 是 equal_comparable_with SomeOtherType ?
假设我有一个MyCustomType与SomeOtherType struct SomeOtherType int value constexpr bool operator const SomeOtherType rhs const de
c
C20
cconcepts
C++20 中概念的语法
在这个问题中我们如何转换需求link https stackoverflow com questions 67133581 check if type has certain value types and the keyword valu
c
templates
C20
cconcepts
Concepts(C++20) 可以用作布尔值吗?
using T decltype std same as
c
C20
cconcepts
约束包含仅适用于概念吗?
考虑这个例子 template
c
cconcepts
C20
C++20 概念:约束规范化
这是 C 20 标准 ISO IEC 14882 2020 第 13 5 4 节 温度 施工 正常 https eel is c draft temp constr normal 第 1 段 强调我的 概念 ID C 的范式是约束表达式在每
c
templates
constraints
C20
cconcepts
如何确保weak_ptr不是从临时的shared_ptr创建的?
我们来上课吧Foo和方法void use weak ptr std weak ptr
c
C20
typetraits
cconcepts
weakptr
实现 std::iter_difference_t
我正在实现我自己的范围版本 因为它们尚未包含在标准库中 我陷入了实施困境std iter difference t The 最新草案 http eel is c draft incrementable traits 2 says 方式ite
c
C20
cconcepts
如何写一个简单的范围概念?
如何编写一个概念来描述启用基于范围的 for 循环的类型 一种尝试是 template lt typename Range gt concept bool RRange requires Range range std begin rang
c
range
cconcepts
概念返回类型要求语法二对一模板参数
我想知道如何std same as的定义以及我们如何在概念或需求中使用它 Example void f1 bool f2 return true template lt typename T gt void Do T func if con
c
C20
cconcepts
具有多个模板参数的 C++ 概念
Bjarne Stroustrup 最近发表了report http www stroustrup com good concepts pdf在 C 概念 中 他提到了一些让我感到惊讶的事情 该示例 第 7 1 节中 使用 速记模板表示法
c
templates
cconcepts
1
2
3
4
»