我想做这样的事情:
opt-flags : &opt_flags -DCMAKE_BUILD_TYPE=Release
dbg-flags : &dbg_flags -DCMAKE_BUILD_TYPE=Debug
common-flags: &common -DENABLE_EXAMPLES=ON -DENABLE_TESTS=ON
# concatenate previous definitions to create composed definitions
dbg: *common *dbg_flags
opt: *common *opt_flags
Run Code Online (Sandbox Code Playgroud)
这不能直接起作用。是否可以在 YAML 中执行与此等效的操作?
Is there a way to get the name of a node? For example:
Fruits:
- apple
- orange
- pear
Run Code Online (Sandbox Code Playgroud)
and in C++:
YAML::Node fruit = parser["Fruits"];
cout << fruit.name() << endl; // should print "Fruits"
Run Code Online (Sandbox Code Playgroud)
is there something like YAML::Node::name()? I don't see anything in Node.h that fits the bill.
If there isn't, any suggestions on a simple way to modify the code to record this information?
Thanks!