mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-01-09 17:10:10 +00:00
fix: add SFINAE to avoid incorrect matching
This commit is contained in:
parent
5518b2b155
commit
b592ddcca2
@ -1035,7 +1035,10 @@ find_or(const basic_value<C, M, V>& v, const toml::key& ky, T&& opt)
|
|||||||
|
|
||||||
template<typename T, typename C,
|
template<typename T, typename C,
|
||||||
template<typename ...> class M, template<typename ...> class V,
|
template<typename ...> class M, template<typename ...> class V,
|
||||||
typename ... Ks>
|
typename ... Ks,
|
||||||
|
typename detail::enable_if_t<(sizeof...(Ks) > 1), std::nullptr_t> = nullptr>
|
||||||
|
// here we need to add SFINAE in the template parameter to avoid
|
||||||
|
// infinite recursion in type deduction on gcc
|
||||||
auto find_or(const basic_value<C, M, V>& v, const toml::key& ky, Ks&& ... keys)
|
auto find_or(const basic_value<C, M, V>& v, const toml::key& ky, Ks&& ... keys)
|
||||||
-> decltype(find_or<T>(v, ky, detail::last_one(std::forward<Ks>(keys)...)))
|
-> decltype(find_or<T>(v, ky, detail::last_one(std::forward<Ks>(keys)...)))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user