[associative.set.syn]

# 23 Containers library [[containers]](./#containers)

## 23.4 Associative containers [[associative]](associative#set.syn)

### 23.4.5 Header <set> synopsis [associative.set.syn]

[ð](#header:%3cset%3e)

#include <compare> // see [[compare.syn]](compare.syn "17.12.1 Header <compare> synopsis")#include <initializer_list> // see [[initializer.list.syn]](initializer.list.syn "17.11.2 Header <initializer_­list> synopsis")namespace std {// [[set]](set "23.4.6 Class template set"), class template settemplate<class Key, class Compare = less<Key>, class Allocator = allocator<Key>>class set; template<class Key, class Compare, class Allocator>constexpr bool operator==(const set<Key, Compare, Allocator>& x, const set<Key, Compare, Allocator>& y); template<class Key, class Compare, class Allocator>constexpr *synth-three-way-result*<Key> operator<=>(const set<Key, Compare, Allocator>& x, const set<Key, Compare, Allocator>& y); template<class Key, class Compare, class Allocator>constexpr void swap(set<Key, Compare, Allocator>& x,
 set<Key, Compare, Allocator>& y)noexcept(noexcept(x.swap(y))); // [[set.erasure]](set.erasure "23.4.6.3 Erasure"), erasure for settemplate<class Key, class Compare, class Allocator, class Predicate>constexpr typename set<Key, Compare, Allocator>::size_type
 erase_if(set<Key, Compare, Allocator>& c, Predicate pred); // [[multiset]](multiset "23.4.7 Class template multiset"), class template multisettemplate<class Key, class Compare = less<Key>, class Allocator = allocator<Key>>class multiset; template<class Key, class Compare, class Allocator>constexpr bool operator==(const multiset<Key, Compare, Allocator>& x, const multiset<Key, Compare, Allocator>& y); template<class Key, class Compare, class Allocator>constexpr *synth-three-way-result*<Key>operator<=>(const multiset<Key, Compare, Allocator>& x, const multiset<Key, Compare, Allocator>& y); template<class Key, class Compare, class Allocator>constexpr void swap(multiset<Key, Compare, Allocator>& x,
 multiset<Key, Compare, Allocator>& y)noexcept(noexcept(x.swap(y))); // [[multiset.erasure]](multiset.erasure "23.4.7.3 Erasure"), erasure for multisettemplate<class Key, class Compare, class Allocator, class Predicate>constexpr typename multiset<Key, Compare, Allocator>::size_type
 erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); namespace pmr {template<class Key, class Compare = less<Key>>using set = std::set<Key, Compare, polymorphic_allocator<Key>>; template<class Key, class Compare = less<Key>>using multiset = std::multiset<Key, Compare, polymorphic_allocator<Key>>; }}
