如题,参照这篇博客配置 c++20,但语法检查规则并没有同步到 c++20。这是我的 c_cpp_properties.json 配置:
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "F:\\mingw64\\bin\\gcc.exe",
"cStandard": "gnu17",
"cppStandard": "gnu++20",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}
“问题”一栏报错信息:
后面有“::”的名称一定是类名或命名空间名
代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
cout << fixed << setprecision(9) << numbers::pi_v<double> << '\n';
return 0;
}
能编译成功并输出正确结果。