mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 00:38:08 +08:00
permit tie with non-match types in from_toml
This commit is contained in:
@@ -121,6 +121,9 @@ toml::from_toml(std::tie(i, d, s, a), data.at("something"));
|
|||||||
|
|
||||||
Here, only matched value will be filled.
|
Here, only matched value will be filled.
|
||||||
The others are left intact after calling `from_toml`.
|
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.
|
`from_toml` can be used also for single type.
|
||||||
|
|
||||||
|
@@ -100,7 +100,7 @@ struct from_toml_tie_impl<0, Ts...>
|
|||||||
{
|
{
|
||||||
static void invoke(std::tuple<Ts& ...> tie, const toml::value& v)
|
static void invoke(std::tuple<Ts& ...> tie, const toml::value& v)
|
||||||
{
|
{
|
||||||
throw type_error("from_toml(tie, value): no match");
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user