Open momentarylapse opened 7 months ago
Hi, I'm getting some weird output when trying to write 2-dimensional arrays with objects/tables inside. I'm trying to save the equivalent of JSON {"A": [ [ {"value": 1} ] ] }.
{"A": [ [ {"value": 1} ] ] }
My code:
toml::Value base; toml::Array outer; toml::Array inner; toml::Value object; object["value"] = 1; inner.push_back(object); outer.push_back(inner); base["A"] = outer; base.write(&std::cout);
The code produces:
A = [[value = 1 ]]
and toml::parse() flags this as invalid.
toml::parse()
Could the curly braces be missing for a correct inline table? I.e.
A = [[{value = 1}]]
Or is there something I should do differently in the code?
Thanks, Michael
Hi, I'm getting some weird output when trying to write 2-dimensional arrays with objects/tables inside. I'm trying to save the equivalent of JSON
{"A": [ [ {"value": 1} ] ] }
.My code:
The code produces:
and
toml::parse()
flags this as invalid.Could the curly braces be missing for a correct inline table? I.e.
Or is there something I should do differently in the code?
Thanks, Michael