3 #include <unordered_set> 14 template <
typename Key,
typename Hash,
typename KeyEqual,
typename Alloc>
15 struct hash<unordered_set<Key, Hash, KeyEqual, Alloc>>
17 using type = unordered_set<Key, Hash, KeyEqual, Alloc>;
35 template <
typename Key,
typename Hash,
typename KeyEqual,
typename Alloc>
37 has(
const std::unordered_set<Key, Hash, KeyEqual, Alloc>& s,
const Key& k)
39 return s.find(k) != std::end(s);
43 template <
typename Key,
typename Hash,
typename KeyEqual,
typename Alloc>
44 std::unordered_set<Key, Hash, KeyEqual, Alloc>
46 const std::unordered_set<Key, Hash, KeyEqual, Alloc>& s2)
48 if (s2.size() < s1.size())
52 auto res = std::unordered_set<Key, Hash, KeyEqual, Alloc>{};
53 for (
const auto& e : s1)
unordered_set< Key, Hash, KeyEqual, Alloc > type
bool has(const std::unordered_set< Key, Hash, KeyEqual, Alloc > &s, const Key &k)
Whether e is member of s.
size_t operator()(const type &ss) const
std::unordered_set< Key, Hash, KeyEqual, Alloc > set_intersection(const std::unordered_set< Key, Hash, KeyEqual, Alloc > &s1, const std::unordered_set< Key, Hash, KeyEqual, Alloc > &s2)
Intersection of s1 and s2.