diff --git a/toml/traits.hpp b/toml/traits.hpp index 4fc1bda..2fd36a2 100644 --- a/toml/traits.hpp +++ b/toml/traits.hpp @@ -43,17 +43,23 @@ struct has_mapped_type_impl template static std::true_type check(typename T::mapped_type*); template static std::false_type check(...); }; -struct has_resize_method_impl +struct has_reserve_method_impl { - constexpr static std::size_t dummy=0; - template static std::true_type check(decltype(std::declval().resize(dummy))*); template static std::false_type check(...); + template static std::true_type check( + decltype(std::declval().reserve(std::declval()))*); +}; +struct has_push_back_method_impl +{ + template static std::false_type check(...); + template static std::true_type check( + decltype(std::declval().push_back(std::declval()))*); }; - struct is_comparable_impl { - template static std::true_type check(decltype(std::declval() < std::declval())*); template static std::false_type check(...); + template static std::true_type check( + decltype(std::declval() < std::declval())*); }; struct has_from_toml_method_impl @@ -91,7 +97,9 @@ struct has_key_type : decltype(has_key_type_impl::check(nullptr)){}; template struct has_mapped_type : decltype(has_mapped_type_impl::check(nullptr)){}; template -struct has_resize_method : decltype(has_resize_method_impl::check(nullptr)){}; +struct has_reserve_method : decltype(has_reserve_method_impl::check(nullptr)){}; +template +struct has_push_back_method : decltype(has_push_back_method_impl::check(nullptr)){}; template struct is_comparable : decltype(is_comparable_impl::check(nullptr)){};