关于 Vscode 语法检查规则
  • 板块灌水区
  • 楼主紪絽
  • 当前回复7
  • 已保存回复7
  • 发布时间2022/7/29 22:02
  • 上次更新2023/10/27 17:47:03
查看原帖
关于 Vscode 语法检查规则
205199
紪絽楼主2022/7/29 22:02

如题,参照这篇博客配置 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;
}

能编译成功并输出正确结果。

2022/7/29 22:02
加载中...