We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/wanghenshui/cppweeklynews/blob/dev/posts/126.md#c20-dynamic-allocations-at-compile-time
我看了一下原文,原文是最后将 Calc 标识为 constexpr,然后用 as_constant 函数强制这个 constexpr 函数在编译期计算。
您的原文中,将 Calc 函数标识为 consteval,后面加不加 as_constant 都会强制编译期计算。而且,res 本身是一个 run-time 变量,再作为参数调用 Calc 是百分百失败的。
我猜测是您笔误,将 Calc 函数标记错了?
The text was updated successfully, but these errors were encountered:
你说的对,抄错了
Sorry, something went wrong.
fix #68 typo
7dc2091
9963be1
No branches or pull requests
位置
https://github.com/wanghenshui/cppweeklynews/blob/dev/posts/126.md#c20-dynamic-allocations-at-compile-time
问题
我看了一下原文,原文是最后将 Calc 标识为 constexpr,然后用 as_constant 函数强制这个 constexpr 函数在编译期计算。
您的原文中,将 Calc 函数标识为 consteval,后面加不加 as_constant 都会强制编译期计算。而且,res 本身是一个 run-time 变量,再作为参数调用 Calc 是百分百失败的。
我猜测是您笔误,将 Calc 函数标记错了?
The text was updated successfully, but these errors were encountered: