permit tie with non-match types in from_toml

This commit is contained in:
ToruNiina 2017-05-19 14:44:05 +09:00
parent a198a5f103
commit 8a98ce8e35
2 changed files with 4 additions and 1 deletions

View File

@ -121,6 +121,9 @@ toml::from_toml(std::tie(i, d, s, a), data.at("something"));
Here, only matched value will be filled.
The others are left intact after calling `from_toml`.
It should be noted that `toml::from_toml` _returns as usual even if there are no
matched type_.
`from_toml` can be used also for single type.

View File

@ -100,7 +100,7 @@ struct from_toml_tie_impl<0, Ts...>
{
static void invoke(std::tuple<Ts& ...> tie, const toml::value& v)
{
throw type_error("from_toml(tie, value): no match");
return;
}
};