diff --git a/toml/get.hpp b/toml/get.hpp index f941a75..0f9aeab 100644 --- a/toml/get.hpp +++ b/toml/get.hpp @@ -1035,7 +1035,10 @@ find_or(const basic_value& v, const toml::key& ky, T&& opt) template class M, template 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& v, const toml::key& ky, Ks&& ... keys) -> decltype(find_or(v, ky, detail::last_one(std::forward(keys)...))) {