mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Added half of the std::map conversion (we don't have reading from Values yet)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "yaml-cpp/value.h"
|
||||
#include <map>
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -12,5 +13,12 @@ int main()
|
||||
value["monkey"] = 5;
|
||||
std::cout << value["monkey"].as<int>() << "\n";
|
||||
|
||||
std::map<int, std::string> names;
|
||||
names[1] = "one";
|
||||
names[2] = "two";
|
||||
names[3] = "three";
|
||||
names[4] = "four";
|
||||
value["names"] = names;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user