更改cpp_properties.json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/c++/5/**",
"/usr/include/x86_64-linux-gnu/c++/5/**",
"/usr/include/c++/5/backward/**",
"/usr/lib/gcc/x86_64-linux-gnu/5/include/**",
"/usr/local/include/**",
"/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/**",
"/usr/include/x86_64-linux-gnu/**",
"/usr/include/**"
],
"defines": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++11",
"intelliSenseMode": "linux-clang-x64"
}
],
"version": 4
}
最关键的一点,"cppStandard": "C++11".