mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
refactor: remove unsupported overload
expect<T>(table, ...)
This commit is contained in:
17
toml/get.hpp
17
toml/get.hpp
@@ -923,21 +923,6 @@ expect(const basic_value<C, M, V>& v, const toml::key& k) noexcept
|
|||||||
return err(e.what());
|
return err(e.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template<typename T, typename Table>
|
|
||||||
detail::enable_if_t<detail::conjunction<
|
|
||||||
detail::is_map<Table>, detail::is_basic_value<typename Table::mapped_type>
|
|
||||||
>::value, result<T, std::string>>
|
|
||||||
expect(const Table& t, const toml::key& k,
|
|
||||||
std::string tablename = "unknown table") noexcept
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return ok(find<T>(t, k, std::move(tablename)));
|
|
||||||
}
|
|
||||||
catch(const std::exception& e)
|
|
||||||
{
|
|
||||||
return err(e.what());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // toml
|
} // toml
|
||||||
#endif// TOML11_GET
|
#endif// TOML11_GET
|
||||||
|
Reference in New Issue
Block a user