mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 19:10:11 +08:00
Update get.hpp
This commit is contained in:
@@ -398,6 +398,25 @@ get(const basic_value<TC>& v)
|
|||||||
cxx::make_index_sequence<std::tuple_size<T>::value>{});
|
cxx::make_index_sequence<std::tuple_size<T>::value>{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// std::unordered_set
|
||||||
|
|
||||||
|
template<typename T, typename TC>
|
||||||
|
cxx::enable_if_t<toml::detail::is_unordered_set<T>::value, T>
|
||||||
|
get(const basic_value<TC>& v)
|
||||||
|
{
|
||||||
|
using value_type = T;
|
||||||
|
const auto& a = v.as_array();
|
||||||
|
|
||||||
|
std::unordered_set<T> container;
|
||||||
|
for (const auto& elem : a)
|
||||||
|
{
|
||||||
|
container.insert(get<value_type>(elem));
|
||||||
|
}
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// map-like types; most likely STL map, like std::map or std::unordered_map.
|
// map-like types; most likely STL map, like std::map or std::unordered_map.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user