[flat.multimap.defn] # 23 Containers library [[containers]](./#containers) ## 23.6 Container adaptors [[container.adaptors]](container.adaptors#flat.multimap.defn) ### 23.6.9 Class template flat_multimap [[flat.multimap]](flat.multimap#defn) #### 23.6.9.2 Definition [flat.multimap.defn] namespace std {template, class KeyContainer = vector, class MappedContainer = vector>class flat_multimap {public:// typesusing key_type = Key; using mapped_type = T; using value_type = pair; using key_compare = Compare; using reference = pair; using const_reference = pair; using size_type = size_t; using difference_type = ptrdiff_t; using iterator = *implementation-defined*; // see [[container.requirements]](container.requirements "23.2 Requirements")using const_iterator = *implementation-defined*; // see [[container.requirements]](container.requirements "23.2 Requirements")using reverse_iterator = std::reverse_iterator; using const_reverse_iterator = std::reverse_iterator; using key_container_type = KeyContainer; using mapped_container_type = MappedContainer; class value_compare {private: key_compare *comp*; // *exposition only*constexpr value_compare(key_compare c) : *comp*(c) { } // *exposition only*public:constexpr bool operator()(const_reference x, const_reference y) const {return *comp*(x.first, y.first); }}; struct containers { key_container_type keys; mapped_container_type values; }; // [[flat.multimap.cons]](flat.multimap.cons "23.6.9.3 Constructors"), constructorsconstexpr flat_multimap() : flat_multimap(key_compare()) { }constexpr explicit flat_multimap(const key_compare& comp): *c*(), *compare*(comp) { }constexpr flat_multimap(key_container_type key_cont, mapped_container_type mapped_cont, const key_compare& comp = key_compare()); constexpr flat_multimap(sorted_equivalent_t, key_container_type key_cont, mapped_container_type mapped_cont, const key_compare& comp = key_compare()); templateconstexpr flat_multimap(InputIterator first, InputIterator last, const key_compare& comp = key_compare()): *c*(), *compare*(comp){ insert(first, last); }templateconstexpr flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, const key_compare& comp = key_compare()): *c*(), *compare*(comp) { insert(sorted_equivalent, first, last); }template<[*container-compatible-range*](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]") R>constexpr flat_multimap(from_range_t, R&& rg): flat_multimap(from_range, std::forward(rg), key_compare()) { }template<[*container-compatible-range*](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]") R>constexpr flat_multimap(from_range_t, R&& rg, const key_compare& comp): flat_multimap(comp) { insert_range(std::forward(rg)); }constexpr flat_multimap(initializer_list il, const key_compare& comp = key_compare()): flat_multimap(il.begin(), il.end(), comp) { }constexpr flat_multimap(sorted_equivalent_t, initializer_list il, const key_compare& comp = key_compare()): flat_multimap(sorted_equivalent, il.begin(), il.end(), comp) { }// [[flat.multimap.cons.alloc]](flat.multimap.cons.alloc "23.6.9.4 Constructors with allocators"), constructors with allocatorstemplateconstexpr explicit flat_multimap(const Alloc& a); templateconstexpr flat_multimap(const key_compare& comp, const Alloc& a); templateconstexpr flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, const Alloc& a); templateconstexpr flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, const key_compare& comp, const Alloc& a); templateconstexpr flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, const mapped_container_type& mapped_cont, const Alloc& a); templateconstexpr flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, const mapped_container_type& mapped_cont, const key_compare& comp, const Alloc& a); templateconstexpr flat_multimap(const flat_multimap&, const Alloc& a); templateconstexpr flat_multimap(flat_multimap&&, const Alloc& a); templateconstexpr flat_multimap(InputIterator first, InputIterator last, const Alloc& a); templateconstexpr flat_multimap(InputIterator first, InputIterator last, const key_compare& comp, const Alloc& a); templateconstexpr flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, const Alloc& a); templateconstexpr flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, const key_compare& comp, const Alloc& a); template<[*container-compatible-range*](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]") R, class Alloc>constexpr flat_multimap(from_range_t, R&& rg, const Alloc& a); template<[*container-compatible-range*](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]") R, class Alloc>constexpr flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); templateconstexpr flat_multimap(initializer_list il, const Alloc& a); templateconstexpr flat_multimap(initializer_list il, const key_compare& comp, const Alloc& a); templateconstexpr flat_multimap(sorted_equivalent_t, initializer_list il, const Alloc& a); templateconstexpr flat_multimap(sorted_equivalent_t, initializer_list il, const key_compare& comp, const Alloc& a); flat_multimap& operator=(initializer_list); // iteratorsconstexpr iterator begin() noexcept; constexpr const_iterator begin() const noexcept; constexpr iterator end() noexcept; constexpr const_iterator end() const noexcept; constexpr reverse_iterator rbegin() noexcept; constexpr const_reverse_iterator rbegin() const noexcept; constexpr reverse_iterator rend() noexcept; constexpr const_reverse_iterator rend() const noexcept; constexpr const_iterator cbegin() const noexcept; constexpr const_iterator cend() const noexcept; constexpr const_reverse_iterator crbegin() const noexcept; constexpr const_reverse_iterator crend() const noexcept; // capacityconstexpr bool empty() const noexcept; constexpr size_type size() const noexcept; constexpr size_type max_size() const noexcept; // modifierstemplate constexpr iterator emplace(Args&&... args); templateconstexpr iterator emplace_hint(const_iterator position, Args&&... args); constexpr iterator insert(const value_type& x){ return emplace(x); }constexpr iterator insert(value_type&& x){ return emplace(std::move(x)); }constexpr iterator insert(const_iterator position, const value_type& x){ return emplace_hint(position, x); }constexpr iterator insert(const_iterator position, value_type&& x){ return emplace_hint(position, std::move(x)); }template constexpr iterator insert(P&& x); templateconstexpr iterator insert(const_iterator position, P&&); templateconstexpr void insert(InputIterator first, InputIterator last); templateconstexpr void insert(sorted_equivalent_t, InputIterator first, InputIterator last); template<[*container-compatible-range*](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]") R>constexpr void insert_range(R&& rg); constexpr void insert(initializer_list il){ insert(il.begin(), il.end()); }constexpr void insert(sorted_equivalent_t, initializer_list il){ insert(sorted_equivalent, il.begin(), il.end()); }constexpr containers extract() &&; constexpr void replace(key_container_type&& key_cont, mapped_container_type&& mapped_cont); constexpr iterator erase(iterator position); constexpr iterator erase(const_iterator position); constexpr size_type erase(const key_type& x); template constexpr size_type erase(K&& x); constexpr iterator erase(const_iterator first, const_iterator last); constexpr void swap(flat_multimap&) noexcept; constexpr void clear() noexcept; // observersconstexpr key_compare key_comp() const; constexpr value_compare value_comp() const; constexpr const key_container_type& keys() const noexcept { return *c*.keys; }constexpr const mapped_container_type& values() const noexcept { return *c*.values; }// map operationsconstexpr iterator find(const key_type& x); constexpr const_iterator find(const key_type& x) const; template constexpr iterator find(const K& x); template constexpr const_iterator find(const K& x) const; constexpr size_type count(const key_type& x) const; template constexpr size_type count(const K& x) const; constexpr bool contains(const key_type& x) const; template constexpr bool contains(const K& x) const; constexpr iterator lower_bound(const key_type& x); constexpr const_iterator lower_bound(const key_type& x) const; template constexpr iterator lower_bound(const K& x); template constexpr const_iterator lower_bound(const K& x) const; constexpr iterator upper_bound(const key_type& x); constexpr const_iterator upper_bound(const key_type& x) const; template constexpr iterator upper_bound(const K& x); template constexpr const_iterator upper_bound(const K& x) const; constexpr pair equal_range(const key_type& x); constexpr pair equal_range(const key_type& x) const; templateconstexpr pair equal_range(const K& x); templateconstexpr pair equal_range(const K& x) const; friend constexpr bool operator==(const flat_multimap& x, const flat_multimap& y); friend constexpr *synth-three-way-result*operator<=>(const flat_multimap& x, const flat_multimap& y); friend constexpr void swap(flat_multimap& x, flat_multimap& y) noexcept{ x.swap(y); }private: containers *c*; // *exposition only* key_compare *compare*; // *exposition only*}; template> flat_multimap(KeyContainer, MappedContainer, Compare = Compare())-> flat_multimap; template flat_multimap(KeyContainer, MappedContainer, Allocator)-> flat_multimap, KeyContainer, MappedContainer>; template flat_multimap(KeyContainer, MappedContainer, Compare, Allocator)-> flat_multimap; template> flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Compare = Compare())-> flat_multimap; template flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Allocator)-> flat_multimap, KeyContainer, MappedContainer>; template flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Compare, Allocator)-> flat_multimap; template>> flat_multimap(InputIterator, InputIterator, Compare = Compare())-> flat_multimap<*iter-key-type*, *iter-mapped-type*, Compare>; template>> flat_multimap(sorted_equivalent_t, InputIterator, InputIterator, Compare = Compare())-> flat_multimap<*iter-key-type*, *iter-mapped-type*, Compare>; template>, class Allocator = allocator> flat_multimap(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())-> flat_multimap<*range-key-type*, *range-mapped-type*, Compare, vector<*range-key-type*, *alloc-rebind*>>, vector<*range-mapped-type*, *alloc-rebind*>>>; template flat_multimap(from_range_t, R&&, Allocator)-> flat_multimap<*range-key-type*, *range-mapped-type*, less<*range-key-type*>, vector<*range-key-type*, *alloc-rebind*>>, vector<*range-mapped-type*, *alloc-rebind*>>>; template> flat_multimap(initializer_list>, Compare = Compare())-> flat_multimap; template> flat_multimap(sorted_equivalent_t, initializer_list>, Compare = Compare())-> flat_multimap; templatestruct uses_allocator, Allocator>: bool_constant && uses_allocator_v> { };} [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18572) The member type containers has the data members and special members specified above[.](#1.sentence-1) It has no base classes or members other than those specified[.](#1.sentence-2)