mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
add default template arg to toml::find
in most of the use cases, toml::value is used (to show error message).
This commit is contained in:
12
toml/get.hpp
12
toml/get.hpp
@@ -295,7 +295,7 @@ T get(const toml::value& v)
|
||||
// ============================================================================
|
||||
// find and get
|
||||
|
||||
template<typename T>
|
||||
template<typename T = ::toml::value>
|
||||
decltype(::toml::get<T>(std::declval<const ::toml::value&>()))
|
||||
find(const toml::table& tab, const toml::key& ky,
|
||||
std::string tablename = "unknown table")
|
||||
@@ -307,7 +307,7 @@ find(const toml::table& tab, const toml::key& ky,
|
||||
}
|
||||
return ::toml::get<T>(tab.at(ky));
|
||||
}
|
||||
template<typename T>
|
||||
template<typename T = ::toml::value>
|
||||
decltype(::toml::get<T>(std::declval<::toml::value&>()))
|
||||
find(toml::table& tab, const toml::key& ky,
|
||||
std::string tablename = "unknown table")
|
||||
@@ -319,7 +319,7 @@ find(toml::table& tab, const toml::key& ky,
|
||||
}
|
||||
return ::toml::get<T>(tab[ky]);
|
||||
}
|
||||
template<typename T>
|
||||
template<typename T = ::toml::value>
|
||||
decltype(::toml::get<T>(std::declval<::toml::value&&>()))
|
||||
find(toml::table&& tab, const toml::key& ky,
|
||||
std::string tablename = "unknown table")
|
||||
@@ -332,7 +332,7 @@ find(toml::table&& tab, const toml::key& ky,
|
||||
return ::toml::get<T>(std::move(tab[ky]));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
template<typename T = ::toml::value>
|
||||
decltype(::toml::get<T>(std::declval<const ::toml::value&>()))
|
||||
find(const toml::value& v, const toml::key& ky)
|
||||
{
|
||||
@@ -345,7 +345,7 @@ find(const toml::value& v, const toml::key& ky)
|
||||
}
|
||||
return ::toml::get<T>(tab.at(ky));
|
||||
}
|
||||
template<typename T>
|
||||
template<typename T = ::toml::value>
|
||||
decltype(::toml::get<T>(std::declval<::toml::value&>()))
|
||||
find(toml::value& v, const toml::key& ky)
|
||||
{
|
||||
@@ -358,7 +358,7 @@ find(toml::value& v, const toml::key& ky)
|
||||
}
|
||||
return ::toml::get<T>(tab.at(ky));
|
||||
}
|
||||
template<typename T>
|
||||
template<typename T = ::toml::value>
|
||||
decltype(::toml::get<T>(std::declval<::toml::value&&>()))
|
||||
find(toml::value&& v, const toml::key& ky)
|
||||
{
|
||||
|
Reference in New Issue
Block a user