Skip to content
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

How to remove element from toml::basic_value<toml::ordered_type_config>? #282

Closed
SunPodder opened this issue Jan 25, 2025 · 0 comments · Fixed by #283
Closed

How to remove element from toml::basic_value<toml::ordered_type_config>? #282

SunPodder opened this issue Jan 25, 2025 · 0 comments · Fixed by #283

Comments

@SunPodder
Copy link
Contributor

As the title says, how to remove a element from a ordered table? After a bit of searching I've found a solution for toml::value but seems it doesn't work for the ordered_type_config.

auto data = toml::parse<toml::ordered_type_config>(manifestPath);
auto &deps = data["dependencies"];

if (deps.contains(name)) {
	// No member named 'erase' in 'toml::ordered_map<std::basic_string<char>, toml::basic_value<toml::ordered_type_config>>'
	deps.as_table().erase(name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant