diff --git a/toml/get.hpp b/toml/get.hpp index 01dd7c2..92184c3 100644 --- a/toml/get.hpp +++ b/toml/get.hpp @@ -865,12 +865,14 @@ T find_or(const toml::table& tab, const toml::key& ky, T&& opt) if(tab.count(ky) == 0) {return opt;} return get_or(tab.at(ky), std::forward(opt)); } +*/ // ============================================================================ // expect -template -result expect(const toml::value& v) noexcept +template class M, template class V> +result expect(const basic_value& v) noexcept { try { @@ -881,8 +883,10 @@ result expect(const toml::value& v) noexcept return err(e.what()); } } -template -result expect(const toml::value& v, const toml::key& k) noexcept +template class M, template class V> +result +expect(const basic_value& v, const toml::key& k) noexcept { try { @@ -893,9 +897,12 @@ result expect(const toml::value& v, const toml::key& k) noexcept return err(e.what()); } } -template -result expect(const toml::table& t, const toml::key& k, - std::string tablename = "unknown table") noexcept +template +enable_if_t, detail::is_basic_value + >::value, result> +expect(const Table& t, const toml::key& k, + std::string tablename = "unknown table") noexcept { try { @@ -906,6 +913,5 @@ result expect(const toml::table& t, const toml::key& k, return err(e.what()); } } -*/ } // toml #endif// TOML11_GET