When I'm running following code with yaml-cpp library:
YAML::Node node1 = YAML::Load("{ hello: [item1, item2] }");
YAML::Node node2 = node1;
node1 = node1["hello"];
std::cout << node2 << "\n";
std::cout << node1 << "\n";
I end up with same node contained in both node1 and node2 variables. It prints [item1, item2] in both cases. Is it the right behavior or something is messed up? I'm wondering how can I keep reference at original node?
I use g++ 5.1.0 and boost 1.59.0 if it matters.