From a01fe3b4c14c6d7b99ee3f07c9e80058c6403097 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Mon, 31 Mar 2025 16:36:19 +0000 Subject: [PATCH] feat [skip ci]: update single_include --- single_include/toml.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/single_include/toml.hpp b/single_include/toml.hpp index 6310050..e072445 100644 --- a/single_include/toml.hpp +++ b/single_include/toml.hpp @@ -3653,6 +3653,7 @@ struct from; #include #include #include +#include #include #if defined(TOML11_HAS_STRING_VIEW) @@ -3807,6 +3808,12 @@ struct is_std_tuple_impl> : std::true_type{}; template using is_std_tuple = is_std_tuple_impl>; +template struct is_unordered_set_impl : std::false_type {}; +template +struct is_unordered_set_impl> : std::true_type {}; +template +using is_unordered_set = is_unordered_set_impl>; + #if defined(TOML11_HAS_OPTIONAL) template struct is_std_optional_impl : std::false_type{}; template @@ -9227,6 +9234,25 @@ get(const basic_value& v) cxx::make_index_sequence::value>{}); } +// ============================================================================ +// std::unordered_set + +template +cxx::enable_if_t::value, T> +get(const basic_value& v) +{ + using value_type = typename T::value_type; + const auto& a = v.as_array(); + + T container; + for (const auto& elem : a) + { + container.insert(get(elem)); + } + return container; +} + + // ============================================================================ // map-like types; most likely STL map, like std::map or std::unordered_map.