1
无法从管理使用YAML-CPP库YAML节点中删除子节点。这是我想要的代码:删除节点,我似乎
YAML::Node y = YAML::Load("\
a: first\n\
b: second\n\
c: \n\
d: third\n\
e: \n\
f: fourth\n\
g: fifth\n\
");
cout << y;
cout << endl << endl;
y.remove(y["b"]);
cout << y;
cout << endl;
,这是输出:
a: first
c:
e:
g: fifth
f: fourth
d: third
b: second
a: first
c:
e:
g: fifth
f: fourth
d: third
b: second
而预期输出应该是与第二发射YAML流不包含在“B”元素。
缺少什么我在这里?谢谢:)