我有代码:
struct A {
int a;
};
struct B {
int b;
const A a[2];
};
struct C {
int c;
const B b[2];
};
const C test = {0, {}};
int main()
{
return test.c;
}
Run Code Online (Sandbox Code Playgroud)
我有gcc 4.8.2和4.9.2.它可以很好地编译:
g++-4.9 -Wall test.cpp -o test
g++-4.8 -std=c++11 -Wall test.cpp -o test
g++-4.8 -Wall test.cpp -o test
Run Code Online (Sandbox Code Playgroud)
但是,无法编译:
g++-4.9 -std=c++11 -Wall test.cpp -o test
Run Code Online (Sandbox Code Playgroud)
编译器输出是:
test.cpp:15:22: error: uninitialized const member ‘B::a’
const C test = {0, {}};
^
test.cpp:15:22: error: uninitialized const …Run Code Online (Sandbox Code Playgroud) VSCodeVim使用不同的撤消堆栈,撤消vim撤消堆栈中所有未保存的更改后,它使我很烦,VSCode仍然显示该文件未保存。因此,我想使用VSCode的撤消堆栈,并将“ u”映射到“ Ctrl + z”。我的绑定如下:
Run Code Online (Sandbox Code Playgroud){ "key": "u", "command": "undo", "when": "editorTextFocus && !editorReadonly && vim.active && vim.mode != 'Insert'" }
问题是,即使我指定在vim模式为Insert时也不起作用,它仍会撤消上一次更改并插入'u'。谁能建议重新绑定撤消的正确方法是什么?