From 6569c26e1bb4ee35898fe519d1646dcb18d5935c Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sun, 2 Jun 2019 19:04:32 +0900 Subject: [PATCH] feat: make SFINAE condition strict --- toml/get.hpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/toml/get.hpp b/toml/get.hpp index 92184c3..03cf10e 100644 --- a/toml/get.hpp +++ b/toml/get.hpp @@ -416,8 +416,9 @@ T get(const basic_value& v) // for toml::table. template -enable_if_t::value, decltype( - ::toml::get(std::declval()))> +enable_if_t, + detail::is_basic_value>::value, + decltype(::toml::get(std::declval()))> find(Table& tab, const toml::key& ky, std::string tn = "unknown table") { if(tab.count(ky) == 0) @@ -428,8 +429,9 @@ find(Table& tab, const toml::key& ky, std::string tn = "unknown table") return ::toml::get(tab.at(ky)); } template -enable_if_t::value, decltype( - ::toml::get(std::declval()))> +enable_if_t, + detail::is_basic_value>::value, + decltype(::toml::get(std::declval()))> find(Table const& tab, const toml::key& ky, std::string tn = "unknown table") { if(tab.count(ky) == 0) @@ -440,8 +442,9 @@ find(Table const& tab, const toml::key& ky, std::string tn = "unknown table") return ::toml::get(tab.at(ky)); } template -enable_if_t::value, decltype( - ::toml::get(std::declval()))> +enable_if_t, + detail::is_basic_value>::value, + decltype(::toml::get(std::declval()))> find(typename std::remove_reference&& tab, const toml::key& ky, std::string tn = "unknown table") {