-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
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
对即时函数的调用不是常量表达式 #1
Comments
设置c++版本为17就不会报错了,那如果是要使用c++20有什么方法吗? |
我主要是在linux下,所以msvc没测过20😅 |
应该是C++20对编译期类型检查更严格了,所以这个报错了。 刚才的commit已经修复了
这样改就可以了 |
我也遇到了这个问题,C++20开始要执行编译期的检查,https://fmt.dev/latest/api/#core-api
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
项目采用 c++20
平台 window11
开发工具 Visual Studio 2022
当我直接复制你的代码过去还是会报错,我之前照着几个开源项目学习,每次都是会报错这个。
严重性 代码 说明 项目 文件 行 禁止显示状态 详细信息
错误 C7595 “fmt::v9::basic_format_string<char,const int &>::basic_format_string”: 对即时函数的调用不是常量表达式 C:\Users\wuxianggujun\CodeSpace\CmakeProjects\Tina\out\build\x64-Debug\Tina C:\Users\wuxianggujun\CodeSpace\CmakeProjects\Tina\engine\log\Logger.hpp 283
The text was updated successfully, but these errors were encountered: