consteval

consteval

文章 0 浏览 1

基于方法参数的Consteval方法的返回类型

考虑以下代码: template class foo { [[nodiscard]] consteval static int stoi(std::string_view) { return 1; /* dynamically determined */ } con…

余罪 2025-02-04 08:08:57 1 0

对`sTD :: IS_CONSTANT_EVALED()的未定义引用()在C++ 20 GCC中

这只是一个最小可重复的示例: import ; import ; template class my_class { }; template struct std::hash> { std::size_t operator()(my_class con…

°如果伤别离去 2025-02-01 10:41:51 3 0

为什么 `consteval` 的表现不符合预期?

inline consteval unsigned char operator""_UC(const unsigned long long n) { return static_cast(n); } inline consteval char f1(auto const octe…

蒲公英的约定 2025-01-17 03:21:03 2 0

为什么从对象构造函数调用 consteval 不是常量表达式?

我有如下所示的 consteval 函数: template consteval std::size_t text_id(const char(&a_text)[text_length]) { std::size_t result{text_length}; …

苦笑流年记忆 2025-01-15 04:16:37 2 0

是否可以传递对 consteval 函数的引用并将其用作附加返回值?

有时函数的结果不能用单个返回值表示。例如:与两条线相交的函数。人们可能希望该函数返回实际的交点以及它们之间的关系(即平行、相同、相交或倾斜)…

初见 2025-01-10 02:17:47 1 0
更多

推荐作者

alipaysp_snBf0MSZIv

文章 0 评论 0

梦断已成空

文章 0 评论 0

瞎闹

文章 0 评论 0

寄意

文章 0 评论 0

似梦非梦

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文