From 17def14ab6bf42374b2c4e89847dadd775c30c7e Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 27 Dec 2018 15:58:50 +0900 Subject: [PATCH] add default template arg to toml::find in most of the use cases, toml::value is used (to show error message). --- toml/get.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/toml/get.hpp b/toml/get.hpp index 3dfc056..fe51622 100644 --- a/toml/get.hpp +++ b/toml/get.hpp @@ -295,7 +295,7 @@ T get(const toml::value& v) // ============================================================================ // find and get -template +template decltype(::toml::get(std::declval())) 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(tab.at(ky)); } -template +template decltype(::toml::get(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(tab[ky]); } -template +template decltype(::toml::get(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(std::move(tab[ky])); } -template +template decltype(::toml::get(std::declval())) 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(tab.at(ky)); } -template +template decltype(::toml::get(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(tab.at(ky)); } -template +template decltype(::toml::get(std::declval<::toml::value&&>())) find(toml::value&& v, const toml::key& ky) {