diff --git a/toml/get.hpp b/toml/get.hpp index ce2ea54..6418efe 100644 --- a/toml/get.hpp +++ b/toml/get.hpp @@ -259,6 +259,15 @@ template)> T get(const basic_value&); +// T(const toml::value&) and T is not toml::basic_value +template class M, template class V> +detail::enable_if_t>, + std::is_constructible&> + >::value, T> +get(const basic_value&); + // ============================================================================ // array-like types; most likely STL container, like std::vector, etc. @@ -417,6 +426,17 @@ T get(const basic_value& v) return ::toml::from::from_toml(v); } +template class M, template class V> +detail::enable_if_t>, + std::is_constructible&> + >::value, T> +get(const basic_value& v) +{ + return T(v); +} + // ============================================================================ // find