Hello
I currently use v3.6.0 version of the tomll11 header only library. The parsing part work as expected. But i see few issues w.r.t populating the toml table content in the order as required by the user.
This is a demo program
#include "toml.hpp" // that's all! now you can use it.
#include
#include
#include
int main()
{
toml::value data{{"foo", 42}, {"bar", 3.14}, {"baz", "qux"}};
data["hoge"] = "piyo";
std::stringstream ss;
ss << std::setw(0) << data;
std::cout<<"Actual toml content\n"<<ss.str();
return 0;
}
The output is
Actual toml content
hoge = "piyo"
baz = "qux"
foo = 42
bar = 3.14
It should have been
Actual toml content
hoge = "piyo"
baz = "qux"
bar = 3.14
foo = 42
Any reason for this behaviour?
over-riding the type the std::map will just place the keys in alphabetical order(sorted manner). But in my case i want the key value pairs to be in the order as they are passed. How can we achieve this?
Please give your inputs
Hello
I currently use v3.6.0 version of the tomll11 header only library. The parsing part work as expected. But i see few issues w.r.t populating the toml table content in the order as required by the user.
This is a demo program
#include "toml.hpp" // that's all! now you can use it.
#include
#include
#include
int main()
{
toml::value data{{"foo", 42}, {"bar", 3.14}, {"baz", "qux"}};
data["hoge"] = "piyo";
std::stringstream ss;
ss << std::setw(0) << data;
std::cout<<"Actual toml content\n"<<ss.str();
return 0;
}
The output is
Actual toml content
hoge = "piyo"
baz = "qux"
foo = 42
bar = 3.14
It should have been
Actual toml content
hoge = "piyo"
baz = "qux"
bar = 3.14
foo = 42
Any reason for this behaviour?
over-riding the type the std::map will just place the keys in alphabetical order(sorted manner). But in my case i want the key value pairs to be in the order as they are passed. How can we achieve this?
Please give your inputs