Search code examples
c++yaml-cpp

Yaml-cpp, old api to new api , operator >>


i would like to convert the following sentence, which is in Yaml-cpp old api format to the new api. how to convert doc["Meta"]["type"] >> type to the new API, as operator >> is deleted in the new api. Thanks


Solution

  • Try the following:

    typedef std::string MyType; // I believe, that you're retrieving string
    MyType x = doc["Meta"]["type"].as<MyType>();