From a0cda88c6c64d624f7136ea60519f8432ce0a019 Mon Sep 17 00:00:00 2001 From: Evan <115374841+evanwporter@users.noreply.github.com> Date: Sun, 30 Mar 2025 09:26:36 -0700 Subject: [PATCH] Update get.hpp --- include/toml11/get.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/toml11/get.hpp b/include/toml11/get.hpp index 3805d09..ecf62c7 100644 --- a/include/toml11/get.hpp +++ b/include/toml11/get.hpp @@ -398,6 +398,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 = T; + const auto& a = v.as_array(); + + std::unordered_set 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.