diff --git a/include/toml11/from.hpp b/include/toml11/from.hpp index d2e0e13..280cc40 100644 --- a/include/toml11/from.hpp +++ b/include/toml11/from.hpp @@ -7,7 +7,18 @@ namespace toml template struct from; // { -// static T from_toml(const toml::value& v) +// template +// static T from_toml(const toml::basic_value& v) +// { +// // User-defined conversions ... +// } +// }; + +template +struct try_from; +// { +// template +// static result try_from_toml(const toml::basic_value& v) noexcept // { // // User-defined conversions ... // } diff --git a/include/toml11/traits.hpp b/include/toml11/traits.hpp index 0a0fa79..946f760 100644 --- a/include/toml11/traits.hpp +++ b/include/toml11/traits.hpp @@ -90,6 +90,13 @@ struct has_specialized_from_impl template)> static std::true_type check(::toml::from*); }; +struct has_specialized_try_from_impl +{ + template + static std::false_type check(...); + template)> + static std::true_type check(::toml::try_from*); +}; struct has_specialized_into_impl { template @@ -130,6 +137,8 @@ template struct has_specialized_from: decltype(has_specialized_from_impl::check(nullptr)){}; template struct has_specialized_into: decltype(has_specialized_into_impl::check(nullptr)){}; +template +struct has_specialized_try_from: decltype(has_specialized_try_from_impl::check(nullptr)){}; #ifdef __INTEL_COMPILER #undef decltype