Init
This commit is contained in:
49
cppdraft/flat/multimap/cons.md
Normal file
49
cppdraft/flat/multimap/cons.md
Normal file
@@ -0,0 +1,49 @@
|
||||
[flat.multimap.cons]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#flat.multimap.cons)
|
||||
|
||||
### 23.6.9 Class template flat_multimap [[flat.multimap]](flat.multimap#cons)
|
||||
|
||||
#### 23.6.9.3 Constructors [flat.multimap.cons]
|
||||
|
||||
[ð](#lib:flat_multimap,constructor)
|
||||
|
||||
`constexpr flat_multimap(key_container_type key_cont, mapped_container_type mapped_cont,
|
||||
const key_compare& comp = key_compare());
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18586)
|
||||
|
||||
*Effects*: Initializes*c*.keys with std::move(key_cont),*c*.values with std::move(mapped_cont), and*compare* with comp;
|
||||
sorts the range [begin(), end()) with respect to value_comp()[.](#1.sentence-1)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18594)
|
||||
|
||||
*Complexity*: Linear in N if the container arguments are already sorted
|
||||
with respect to value_comp() and otherwise NlogN,
|
||||
where N is the value of key_cont.size() before this call[.](#2.sentence-1)
|
||||
|
||||
[ð](#lib:flat_multimap,constructor_)
|
||||
|
||||
`constexpr flat_multimap(sorted_equivalent_t, key_container_type key_cont,
|
||||
mapped_container_type mapped_cont,
|
||||
const key_compare& comp = key_compare());
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18609)
|
||||
|
||||
*Effects*: Initializes*c*.keys with std::move(key_cont),*c*.values with std::move(mapped_cont), and*compare* with comp[.](#3.sentence-1)
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18616)
|
||||
|
||||
*Complexity*: Constant[.](#4.sentence-1)
|
||||
111
cppdraft/flat/multimap/cons/alloc.md
Normal file
111
cppdraft/flat/multimap/cons/alloc.md
Normal file
@@ -0,0 +1,111 @@
|
||||
[flat.multimap.cons.alloc]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#flat.multimap.cons.alloc)
|
||||
|
||||
### 23.6.9 Class template flat_multimap [[flat.multimap]](flat.multimap#cons.alloc)
|
||||
|
||||
#### 23.6.9.4 Constructors with allocators [flat.multimap.cons.alloc]
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18623)
|
||||
|
||||
The constructors in this subclause shall not participate in overload resolution
|
||||
unless uses_allocator_v<key_container_type, Alloc> is true and uses_allocator_v<mapped_container_type, Alloc> is true[.](#1.sentence-1)
|
||||
|
||||
[ð](#lib:flat_multimap,constructor)
|
||||
|
||||
`template<class Alloc>
|
||||
constexpr flat_multimap(const key_container_type& key_cont,
|
||||
const mapped_container_type& mapped_cont, const Alloc& a);
|
||||
template<class Alloc>
|
||||
constexpr flat_multimap(const key_container_type& key_cont,
|
||||
const mapped_container_type& mapped_cont,
|
||||
const key_compare& comp, const Alloc& a);
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18640)
|
||||
|
||||
*Effects*: Equivalent to flat_multimap(key_cont, mapped_cont) andflat_multimap(key_cont, mapped_cont, comp), respectively,
|
||||
except that *c*.keys and *c*.values are constructed
|
||||
with uses-allocator construction ([[allocator.uses.construction]](allocator.uses.construction "20.2.8.2 Uses-allocator construction"))[.](#2.sentence-1)
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18647)
|
||||
|
||||
*Complexity*: Same as flat_multimap(key_cont, mapped_cont) andflat_multimap(key_cont, mapped_cont, comp), respectively[.](#3.sentence-1)
|
||||
|
||||
[ð](#lib:flat_multimap,constructor_)
|
||||
|
||||
`template<class Alloc>
|
||||
constexpr flat_multimap(sorted_equivalent_t, const key_container_type& key_cont,
|
||||
const mapped_container_type& mapped_cont, const Alloc& a);
|
||||
template<class Alloc>
|
||||
constexpr flat_multimap(sorted_equivalent_t, const key_container_type& key_cont,
|
||||
const mapped_container_type& mapped_cont, const key_compare& comp,
|
||||
const Alloc& a);
|
||||
`
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18665)
|
||||
|
||||
*Effects*: Equivalent to flat_multimap(sorted_equivalent, key_cont, mapped_cont) andflat_multimap(sorted_equivalent, key_cont, mapped_cont, comp), respectively,
|
||||
except that *c*.keys and *c*.values are constructed
|
||||
with uses-allocator construction ([[allocator.uses.construction]](allocator.uses.construction "20.2.8.2 Uses-allocator construction"))[.](#4.sentence-1)
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18672)
|
||||
|
||||
*Complexity*: Linear[.](#5.sentence-1)
|
||||
|
||||
[ð](#lib:flat_multimap,constructor__)
|
||||
|
||||
`template<class Alloc>
|
||||
constexpr explicit flat_multimap(const Alloc& a);
|
||||
template<class Alloc>
|
||||
constexpr flat_multimap(const key_compare& comp, const Alloc& a);
|
||||
template<class Alloc>
|
||||
constexpr flat_multimap(const flat_multimap&, const Alloc& a);
|
||||
template<class Alloc>
|
||||
constexpr flat_multimap(flat_multimap&&, const Alloc& a);
|
||||
template<class InputIterator, class Alloc>
|
||||
constexpr flat_multimap(InputIterator first, InputIterator last, const Alloc& a);
|
||||
template<class InputIterator, class Alloc>
|
||||
constexpr flat_multimap(InputIterator first, InputIterator last, const key_compare& comp,
|
||||
const Alloc& a);
|
||||
template<class InputIterator, class Alloc>
|
||||
constexpr flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last,
|
||||
const Alloc& a);
|
||||
template<class InputIterator, class Alloc>
|
||||
constexpr 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]")<value_type> 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]")<value_type> R, class Alloc>
|
||||
constexpr flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Alloc& a);
|
||||
template<class Alloc>
|
||||
constexpr flat_multimap(initializer_list<value_type> il, const Alloc& a);
|
||||
template<class Alloc>
|
||||
constexpr flat_multimap(initializer_list<value_type> il, const key_compare& comp,
|
||||
const Alloc& a);
|
||||
template<class Alloc>
|
||||
constexpr flat_multimap(sorted_equivalent_t, initializer_list<value_type> il, const Alloc& a);
|
||||
template<class Alloc>
|
||||
constexpr flat_multimap(sorted_equivalent_t, initializer_list<value_type> il,
|
||||
const key_compare& comp, const Alloc& a);
|
||||
`
|
||||
|
||||
[6](#6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18715)
|
||||
|
||||
*Effects*: Equivalent to the corresponding non-allocator constructors
|
||||
except that *c*.keys and *c*.values are constructed
|
||||
with uses-allocator construction ([[allocator.uses.construction]](allocator.uses.construction "20.2.8.2 Uses-allocator construction"))[.](#6.sentence-1)
|
||||
36
cppdraft/flat/multimap/defn.md
Normal file
36
cppdraft/flat/multimap/defn.md
Normal file
@@ -0,0 +1,36 @@
|
||||
[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 Key, class T, class Compare = less<Key>, class KeyContainer = vector<Key>, class MappedContainer = vector<T>>class flat_multimap {public:// typesusing key_type = Key; using mapped_type = T; using value_type = pair<key_type, mapped_type>; using key_compare = Compare; using reference = pair<const key_type&, mapped_type&>; using const_reference = pair<const key_type&, const mapped_type&>; 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<iterator>; using const_reverse_iterator = std::reverse_iterator<const_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()); template<class InputIterator>constexpr flat_multimap(InputIterator first, InputIterator last, const key_compare& comp = key_compare()): *c*(), *compare*(comp){ insert(first, last); }template<class InputIterator>constexpr 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]")<value_type> R>constexpr flat_multimap(from_range_t, R&& rg): flat_multimap(from_range, std::forward<R>(rg), key_compare()) { }template<[*container-compatible-range*](container.intro.reqmts#concept:container-compatible-range "23.2.2.1 Introduction [container.intro.reqmts]")<value_type> R>constexpr flat_multimap(from_range_t, R&& rg, const key_compare& comp): flat_multimap(comp) { insert_range(std::forward<R>(rg)); }constexpr flat_multimap(initializer_list<value_type> il, const key_compare& comp = key_compare()): flat_multimap(il.begin(), il.end(), comp) { }constexpr flat_multimap(sorted_equivalent_t, initializer_list<value_type> 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 allocatorstemplate<class Alloc>constexpr explicit flat_multimap(const Alloc& a); template<class Alloc>constexpr flat_multimap(const key_compare& comp, const Alloc& a); template<class Alloc>constexpr flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, const Alloc& a); template<class Alloc>constexpr flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, const key_compare& comp, const Alloc& a); template<class Alloc>constexpr flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, const mapped_container_type& mapped_cont, const Alloc& a); template<class Alloc>constexpr flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, const mapped_container_type& mapped_cont, const key_compare& comp, const Alloc& a); template<class Alloc>constexpr flat_multimap(const flat_multimap&, const Alloc& a); template<class Alloc>constexpr flat_multimap(flat_multimap&&, const Alloc& a); template<class InputIterator, class Alloc>constexpr flat_multimap(InputIterator first, InputIterator last, const Alloc& a); template<class InputIterator, class Alloc>constexpr flat_multimap(InputIterator first, InputIterator last, const key_compare& comp, const Alloc& a); template<class InputIterator, class Alloc>constexpr flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, const Alloc& a); template<class InputIterator, class Alloc>constexpr 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]")<value_type> 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]")<value_type> R, class Alloc>constexpr flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); template<class Alloc>constexpr flat_multimap(initializer_list<value_type> il, const Alloc& a); template<class Alloc>constexpr flat_multimap(initializer_list<value_type> il, const key_compare& comp, const Alloc& a); template<class Alloc>constexpr flat_multimap(sorted_equivalent_t, initializer_list<value_type> il, const Alloc& a); template<class Alloc>constexpr flat_multimap(sorted_equivalent_t, initializer_list<value_type> il, const key_compare& comp, const Alloc& a);
|
||||
|
||||
flat_multimap& operator=(initializer_list<value_type>); // 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<class... Args> constexpr iterator emplace(Args&&... args); template<class... Args>constexpr 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<class P> constexpr iterator insert(P&& x); template<class P>constexpr iterator insert(const_iterator position, P&&); template<class InputIterator>constexpr void insert(InputIterator first, InputIterator last); template<class InputIterator>constexpr 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]")<value_type> R>constexpr void insert_range(R&& rg); constexpr void insert(initializer_list<value_type> il){ insert(il.begin(), il.end()); }constexpr void insert(sorted_equivalent_t, initializer_list<value_type> 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<class K> 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<class K> constexpr iterator find(const K& x); template<class K> constexpr const_iterator find(const K& x) const; constexpr size_type count(const key_type& x) const; template<class K> constexpr size_type count(const K& x) const; constexpr bool contains(const key_type& x) const; template<class K> 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<class K> constexpr iterator lower_bound(const K& x); template<class K> 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<class K> constexpr iterator upper_bound(const K& x); template<class K> constexpr const_iterator upper_bound(const K& x) const; constexpr pair<iterator, iterator> equal_range(const key_type& x); constexpr pair<const_iterator, const_iterator> equal_range(const key_type& x) const; template<class K>constexpr pair<iterator, iterator> equal_range(const K& x); template<class K>constexpr pair<const_iterator, const_iterator> equal_range(const K& x) const; friend constexpr bool operator==(const flat_multimap& x, const flat_multimap& y); friend constexpr *synth-three-way-result*<value_type>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<class KeyContainer, class MappedContainer, class Compare = less<typename KeyContainer::value_type>> flat_multimap(KeyContainer, MappedContainer, Compare = Compare())-> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
|
||||
Compare, KeyContainer, MappedContainer>; template<class KeyContainer, class MappedContainer, class Allocator> flat_multimap(KeyContainer, MappedContainer, Allocator)-> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
|
||||
less<typename KeyContainer::value_type>, KeyContainer, MappedContainer>; template<class KeyContainer, class MappedContainer, class Compare, class Allocator> flat_multimap(KeyContainer, MappedContainer, Compare, Allocator)-> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
|
||||
Compare, KeyContainer, MappedContainer>; template<class KeyContainer, class MappedContainer, class Compare = less<typename KeyContainer::value_type>> flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Compare = Compare())-> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
|
||||
Compare, KeyContainer, MappedContainer>; template<class KeyContainer, class MappedContainer, class Allocator> flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Allocator)-> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
|
||||
less<typename KeyContainer::value_type>, KeyContainer, MappedContainer>; template<class KeyContainer, class MappedContainer, class Compare, class Allocator> flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Compare, Allocator)-> flat_multimap<typename KeyContainer::value_type, typename MappedContainer::value_type,
|
||||
Compare, KeyContainer, MappedContainer>; template<class InputIterator, class Compare = less<*iter-key-type*<InputIterator>>> flat_multimap(InputIterator, InputIterator, Compare = Compare())-> flat_multimap<*iter-key-type*<InputIterator>, *iter-mapped-type*<InputIterator>, Compare>; template<class InputIterator, class Compare = less<*iter-key-type*<InputIterator>>> flat_multimap(sorted_equivalent_t, InputIterator, InputIterator, Compare = Compare())-> flat_multimap<*iter-key-type*<InputIterator>, *iter-mapped-type*<InputIterator>, Compare>; template<ranges::[input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]") R, class Compare = less<*range-key-type*<R>>, class Allocator = allocator<byte>> flat_multimap(from_range_t, R&&, Compare = Compare(), Allocator = Allocator())-> flat_multimap<*range-key-type*<R>, *range-mapped-type*<R>, Compare,
|
||||
vector<*range-key-type*<R>, *alloc-rebind*<Allocator, *range-key-type*<R>>>,
|
||||
vector<*range-mapped-type*<R>, *alloc-rebind*<Allocator, *range-mapped-type*<R>>>>; template<ranges::[input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]") R, class Allocator> flat_multimap(from_range_t, R&&, Allocator)-> flat_multimap<*range-key-type*<R>, *range-mapped-type*<R>, less<*range-key-type*<R>>,
|
||||
vector<*range-key-type*<R>, *alloc-rebind*<Allocator, *range-key-type*<R>>>,
|
||||
vector<*range-mapped-type*<R>, *alloc-rebind*<Allocator, *range-mapped-type*<R>>>>; template<class Key, class T, class Compare = less<Key>> flat_multimap(initializer_list<pair<Key, T>>, Compare = Compare())-> flat_multimap<Key, T, Compare>; template<class Key, class T, class Compare = less<Key>> flat_multimap(sorted_equivalent_t, initializer_list<pair<Key, T>>, Compare = Compare())-> flat_multimap<Key, T, Compare>; template<class Key, class T, class Compare, class KeyContainer, class MappedContainer, class Allocator>struct uses_allocator<flat_multimap<Key, T, Compare, KeyContainer, MappedContainer>,
|
||||
Allocator>: bool_constant<uses_allocator_v<KeyContainer, Allocator> && uses_allocator_v<MappedContainer, Allocator>> { };}
|
||||
|
||||
[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)
|
||||
58
cppdraft/flat/multimap/erasure.md
Normal file
58
cppdraft/flat/multimap/erasure.md
Normal file
@@ -0,0 +1,58 @@
|
||||
[flat.multimap.erasure]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#flat.multimap.erasure)
|
||||
|
||||
### 23.6.9 Class template flat_multimap [[flat.multimap]](flat.multimap#erasure)
|
||||
|
||||
#### 23.6.9.5 Erasure [flat.multimap.erasure]
|
||||
|
||||
[ð](#lib:erase_if,flat_multimap)
|
||||
|
||||
`template<class Key, class T, class Compare, class KeyContainer, class MappedContainer,
|
||||
class Predicate>
|
||||
constexpr typename flat_multimap<Key, T, Compare, KeyContainer, MappedContainer>::size_type
|
||||
erase_if(flat_multimap<Key, T, Compare, KeyContainer, MappedContainer>& c, Predicate pred);
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18733)
|
||||
|
||||
*Preconditions*: Key and T meet the *Cpp17MoveAssignable* requirements[.](#1.sentence-1)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18737)
|
||||
|
||||
*Effects*: Let E be bool(pred(pair<const Key&, const T&>(e)))[.](#2.sentence-1)
|
||||
|
||||
Erases all elements e in c for which E holds[.](#2.sentence-2)
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18742)
|
||||
|
||||
*Returns*: The number of elements erased[.](#3.sentence-1)
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18746)
|
||||
|
||||
*Complexity*: Exactly c.size() applications of the predicate[.](#4.sentence-1)
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18750)
|
||||
|
||||
*Remarks*: Stable ([[algorithm.stable]](algorithm.stable "16.4.6.8 Requirements for stable algorithms"))[.](#5.sentence-1)
|
||||
|
||||
If an invocation of erase_if exits via an exception,c is in a valid but unspecified state ([[defns.valid]](defns.valid "3.67 valid but unspecified state"))[.](#5.sentence-2)
|
||||
|
||||
[*Note [1](#note-1)*:
|
||||
|
||||
c still meets its invariants,
|
||||
but can be empty[.](#5.sentence-3)
|
||||
|
||||
â *end note*]
|
||||
165
cppdraft/flat/multimap/overview.md
Normal file
165
cppdraft/flat/multimap/overview.md
Normal file
@@ -0,0 +1,165 @@
|
||||
[flat.multimap.overview]
|
||||
|
||||
# 23 Containers library [[containers]](./#containers)
|
||||
|
||||
## 23.6 Container adaptors [[container.adaptors]](container.adaptors#flat.multimap.overview)
|
||||
|
||||
### 23.6.9 Class template flat_multimap [[flat.multimap]](flat.multimap#overview)
|
||||
|
||||
#### 23.6.9.1 Overview [flat.multimap.overview]
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18148)
|
||||
|
||||
A flat_multimap is a container adaptor
|
||||
that provides an associative container interface
|
||||
that supports equivalent keys
|
||||
(i.e., possibly containing multiple copies of the same key value) and
|
||||
provides for fast retrieval of values of another type T based on the keys[.](#1.sentence-1)
|
||||
|
||||
flat_multimap supports iterators that meet
|
||||
the *Cpp17InputIterator* requirements and
|
||||
model the[random_access_iterator](iterator.concept.random.access#concept:random_access_iterator "24.3.4.13 Concept random_access_iterator [iterator.concept.random.access]") concept ([[iterator.concept.random.access]](iterator.concept.random.access "24.3.4.13 Concept random_access_iterator"))[.](#1.sentence-2)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18161)
|
||||
|
||||
A flat_multimap meets all of the requirements
|
||||
for a container ([[container.reqmts]](container.reqmts "23.2.2.2 Container requirements")) and
|
||||
for a reversible container ([[container.rev.reqmts]](container.rev.reqmts "23.2.2.3 Reversible container requirements")),
|
||||
plus the optional container requirements ([[container.opt.reqmts]](container.opt.reqmts "23.2.2.4 Optional container requirements"))[.](#2.sentence-1)
|
||||
|
||||
flat_multimap meets the requirements of
|
||||
an associative container ([[associative.reqmts]](associative.reqmts "23.2.7 Associative containers")), except that:
|
||||
|
||||
- [(2.1)](#2.1)
|
||||
|
||||
it does not meet the requirements related to node handles ([[container.node]](container.node "23.2.5 Node handles")),
|
||||
|
||||
- [(2.2)](#2.2)
|
||||
|
||||
it does not meet the requirements related to iterator invalidation, and
|
||||
|
||||
- [(2.3)](#2.3)
|
||||
|
||||
the time complexity of the operations
|
||||
that insert or erase a single element from the map is linear,
|
||||
including the ones that take an insertion position iterator[.](#2.sentence-2)
|
||||
|
||||
[*Note [1](#note-1)*:
|
||||
|
||||
A flat_multimap does not meet the additional requirements of an
|
||||
allocator-aware container ([[container.alloc.reqmts]](container.alloc.reqmts "23.2.2.5 Allocator-aware containers"))[.](#2.sentence-3)
|
||||
|
||||
â *end note*]
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18183)
|
||||
|
||||
A flat_multimap also provides most operations described
|
||||
in [[associative.reqmts]](associative.reqmts "23.2.7 Associative containers") for equal keys[.](#3.sentence-1)
|
||||
|
||||
This means that a flat_multimap supports
|
||||
the a_eq operations in [[associative.reqmts]](associative.reqmts "23.2.7 Associative containers") but not the a_uniq operations[.](#3.sentence-2)
|
||||
|
||||
For a flat_multimap<Key, T> the key_type is Key and
|
||||
the value_type is pair<Key, T>[.](#3.sentence-3)
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18193)
|
||||
|
||||
Except as otherwise noted,
|
||||
operations on flat_multimap are equivalent to those of flat_map,
|
||||
except that flat_multimap operations
|
||||
do not remove or replace elements with equal keys[.](#4.sentence-1)
|
||||
|
||||
[*Example [1](#example-1)*:
|
||||
|
||||
flat_multimap constructors and emplace do not erase
|
||||
non-unique elements after sorting them[.](#4.sentence-2)
|
||||
|
||||
â *end example*]
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18203)
|
||||
|
||||
A flat_multimap maintains the following invariants:
|
||||
|
||||
- [(5.1)](#5.1)
|
||||
|
||||
it contains the same number of keys and values;
|
||||
|
||||
- [(5.2)](#5.2)
|
||||
|
||||
the keys are sorted with respect to the comparison object; and
|
||||
|
||||
- [(5.3)](#5.3)
|
||||
|
||||
the value at offset off within the value container is the value
|
||||
associated with the key at offset off within the key container[.](#5.sentence-1)
|
||||
|
||||
[6](#6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18215)
|
||||
|
||||
If any member function in [[flat.multimap.defn]](flat.multimap.defn "23.6.9.2 Definition") exits via an exception,
|
||||
the invariants are restored[.](#6.sentence-1)
|
||||
|
||||
[*Note [2](#note-2)*:
|
||||
|
||||
This can result in the flat_multimap being emptied[.](#6.sentence-2)
|
||||
|
||||
â *end note*]
|
||||
|
||||
[7](#7)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18222)
|
||||
|
||||
Any type C that meets the sequence container requirements ([[sequence.reqmts]](sequence.reqmts "23.2.4 Sequence containers"))
|
||||
can be used to instantiate flat_multimap,
|
||||
as long asC::iterator meets the *Cpp17RandomAccessIterator* requirements and
|
||||
invocations of
|
||||
member functions C::size and C::max_size do not exit via an exception[.](#7.sentence-1)
|
||||
|
||||
In particular,vector ([[vector]](vector "23.3.13 Class template vector")) and deque ([[deque]](deque "23.3.5 Class template deque")) can be used[.](#7.sentence-2)
|
||||
|
||||
[*Note [3](#note-3)*:
|
||||
|
||||
vector<bool> is not a sequence container[.](#7.sentence-3)
|
||||
|
||||
â *end note*]
|
||||
|
||||
[8](#8)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18236)
|
||||
|
||||
The program is ill-formed ifKey is not the same type as KeyContainer::value_type orT is not the same type as MappedContainer::value_type[.](#8.sentence-1)
|
||||
|
||||
[9](#9)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18241)
|
||||
|
||||
The effect of calling a constructor
|
||||
that takes both key_container_type andmapped_container_type arguments
|
||||
with containers of different sizes is undefined[.](#9.sentence-1)
|
||||
|
||||
[10](#10)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18247)
|
||||
|
||||
The effect of calling a constructor or member function
|
||||
that takes a sorted_equivalent_t argument
|
||||
with a container, containers, or range
|
||||
that are not sorted with respect to key_comp() is undefined[.](#10.sentence-1)
|
||||
|
||||
[11](#11)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L18253)
|
||||
|
||||
The types iterator and const_iterator meet
|
||||
the constexpr iterator requirements ([[iterator.requirements.general]](iterator.requirements.general "24.3.1 General"))[.](#11.sentence-1)
|
||||
Reference in New Issue
Block a user