Open SGSSGene opened 3 years ago
It should work if you access it as a string, e.g.
doc1[key2.as<string>()]
It should work if you access it as a string, e.g.
doc1[key2.as<string>()]
Yes of course, but I don't know what key2 is. It does not have to be a std::string, and it should work with std::string.
I have a
YAML::Node
which I use as a map. When accessing the map withstd::string
everything works fine. But if I access it with a YAML::Node which just represents the value of my previousstd::string
it fails.Using
doc1
one fails. I expecteddoc1[key1] == doc1[key2]
. If I create the content of my document withkey2
(see doc2), then everything works as expected.Is this a yaml-cpp bug? Or am I overlooking something?