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>
45 intersection(
const std::unordered_set<Key, Hash, KeyEqual, Alloc>& s1,
46 const std::unordered_set<Key, Hash, KeyEqual, Alloc>& s2)
48 if (s2.size() < s1.size())
52 std::unordered_set<Key, Hash, KeyEqual, Alloc> res;
53 for (
const auto& e : s1)
size_t operator()(const type &ss) const
unordered_set< Key, Hash, KeyEqual, Alloc > type
ATTRIBUTE_PURE bool has(const std::deque< T, Allocator > &s, const T &e)
Whether e is member of s.
std::set< T, Compare, Alloc > intersection(const std::set< T, Compare, Alloc > &set1, const std::set< T, Compare, Alloc > &set2)
The intersection of two sets.