-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserving original order #111
Comments
The serializer dumps the content in the same order as the container has. Since |
Thanks, tsl::ordered_map works perfectly!
When I changed parse part(no.1) only, the nested table was not ordered well. Thank you very much |
Great! And thank you for the detailed information. The default I know it is a confusing behavior. But, AFAIK, there is no way to automatically change the Note that, you can obtain the actual auto file = toml::parse<toml::preserve_comment, tsl::ordered_map>(filename);
auto tables = toml::find<
std::vector<typename decltype(file)::table_type>
>(file, "array_of_table"); But yes, this code looks strange. |
Hi
Is there a way to preserve original order of toml file?
This question is similar with #71.
So, I changed my code to use
toml::parse<toml::preserve_comments, std::map, std::deque>
.But it still does not preserve original order.
I also tried
nlohmann::fifo_map
, but it does not seems to support table array and nested table quite well.Can you recommend a way to preserve original order of toml file?
The text was updated successfully, but these errors were encountered: