diff --git a/source/containers.tex b/source/containers.tex index a0c890b652..bc25b4c628 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -13119,11 +13119,11 @@ \end{codeblock} \rSec2[flatmap.syn]{Header \tcode{} synopsis} -\indexhdr{flatmap}% +\indexheader{flat_map}% \begin{codeblock} -#include -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{flatmap}, class template \tcode{flat_map} @@ -13132,7 +13132,7 @@ class flat_map; struct sorted_unique_t { explicit sorted_unique_t() = default; }; - inline constexpr sorted_unique_t sorted_unique {}; + inline constexpr sorted_unique_t sorted_unique{}; template @@ -13150,7 +13150,7 @@ class flat_multimap; struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; }; - inline constexpr sorted_equivalent_t sorted_equivalent {}; + inline constexpr sorted_equivalent_t sorted_equivalent{}; template @@ -14389,7 +14389,7 @@ \rSec3[flatmap.overview]{Overview} \pnum -\indexlibrary{\idxcode{flatmap}}% +\indexlibraryglobal{flatmap}% A \tcode{flat_map} is a container adaptor that provides an associative container interface that supports unique keys @@ -14403,8 +14403,8 @@ \pnum A \tcode{flat_map} meets all of the requirements -for a container\iref{container.reqmts} and -for a reversible container\iref{container.rev.reqmts}, +of a container\iref{container.reqmts} and +of a reversible container\iref{container.rev.reqmts}, plus the optional container requirements\iref{container.opt.reqmts}. \tcode{flat_map} meets the requirements of an associative container\iref{associative.reqmts}, @@ -14430,7 +14430,7 @@ This means that a \tcode{flat_map} supports the \tcode{a_uniq} operations in \ref{associative.reqmts}, but not the \tcode{a_eq} operations. -For a \tcode{flat_map} +For a \tcode{flat_map} the \tcode{key_type} is \tcode{Key} and the \tcode{value_type} is \tcode{pair}. @@ -14456,7 +14456,7 @@ If any member function in \ref{flatmap.defn} exits via an exception the invariants are restored. \begin{note} -This can result in the \tcode{flat_map}'s being emptied. +This can result in the \tcode{flat_map} being emptied. \end{note} \pnum @@ -14464,7 +14464,7 @@ supporting \oldconcept{RandomAccessIterator} can be used to instantiate \tcode{flat_map}, as long as invocations of -member functions \tcode{C::size} and \tcode{C::max_size} do not throw. +member functions \tcode{C::size} and \tcode{C::max_size} do not exit via an exception. In particular, \tcode{vector}\iref{vector} and \tcode{deque}\iref{deque} can be used. \begin{note} @@ -14507,8 +14507,8 @@ using const_reference = pair; using size_type = size_t; using difference_type = ptrdiff_t; - using iterator = @\impdefx{type of \tcode{flat_map::iterator}}@; // see 24.2 - using const_iterator = @\impdefx{type of \tcode{flat_map::const_iterator}}@; // see 24.2 + using iterator = @\impdefx{type of \tcode{flat_map::iterator}}@; // see \ref{container.requirements} + using const_iterator = @\impdefx{type of \tcode{flat_map::const_iterator}}@; // see \ref{container.requirements} using reverse_iterator = std::reverse_iterator; using const_reverse_iterator = std::reverse_iterator; using key_container_type = KeyContainer; @@ -14561,12 +14561,12 @@ template<@\exposconcept{container-compatible-range}@ R> flat_map(from_range_t fr, R&& rg) - : flat_map(fr, std::forward(range), key_compare()) { } + : flat_map(fr, std::forward(rg), key_compare()) { } template<@\exposconcept{container-compatible-range}@ R, class Allocator> flat_map(from_range_t, R&& rg, const Allocator& a); template<@\exposconcept{container-compatible-range}@ R> flat_map(from_range_t, R&& rg, const key_compare& comp) - : flat_map(comp) { insert_range(std::forward(range)); } + : flat_map(comp) { insert_range(std::forward(rg)); } template<@\exposconcept{container-compatible-range}@ R, class Allocator> flat_map(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); @@ -14740,8 +14740,7 @@ containers c; // \expos key_compare compare; // \expos - // \expos - struct key_equiv { + struct key_equiv { // \expos key_equiv(key_compare c) : comp(c) { } bool operator()(const_reference x, const_reference y) const { return !comp(x.first, y.first) && !comp(y.first, x.first); @@ -14810,7 +14809,7 @@ \rSec3[flatmap.cons]{Constructors} -\indexlibraryctor{flatmap}% +\indexlibraryctor{flat_map}% \begin{itemdecl} flat_map(key_container_type key_cont, mapped_container_type mapped_cont); \end{itemdecl} @@ -14838,7 +14837,7 @@ where $N$ is \tcode{key_cont.size()}. \end{itemdescr} -\indexlibraryctor{flatmap}% +\indexlibraryctor{flat_map}% \begin{itemdecl} template flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, @@ -14862,7 +14861,7 @@ Same as \tcode{flat_map(key_cont, mapped_cont)}. \end{itemdescr} -\indexlibraryctor{flatmap}% +\indexlibraryctor{flat_map}% \begin{itemdecl} flat_map(sorted_unique_t, key_container_type key_cont, mapped_container_type mapped_cont); \end{itemdecl} @@ -14879,7 +14878,7 @@ Constant. \end{itemdescr} -\indexlibraryctor{flatmap}% +\indexlibraryctor{flat_map}% \begin{itemdecl} template flat_map(sorted_unique_t s, const key_container_type& key_cont, @@ -14903,7 +14902,7 @@ Linear. \end{itemdescr} -\indexlibraryctor{flatmap}% +\indexlibraryctor{flat_map}% \begin{itemdecl} template flat_map(const key_compare& comp, const Allocator& a); @@ -14948,7 +14947,7 @@ \rSec3[flatmap.capacity]{Capacity} -\indexlibrarymember{size}{flatmap}% +\indexlibrarymember{size}{flat_map}% \begin{itemdecl} size_type size() const noexcept; \end{itemdecl} @@ -14959,7 +14958,7 @@ \tcode{c.keys.size()}. \end{itemdescr} -\indexlibrarymember{max_size}{flatmap}% +\indexlibrarymember{max_size}{flat_map}% \begin{itemdecl} size_type max_size() const noexcept; \end{itemdecl} @@ -14972,7 +14971,7 @@ \rSec3[flatmap.access]{Access} -\indexlibrarymember{operator[]}{flatmap}% +\indexlibrarymember{operator[]}{flat_map}% \begin{itemdecl} mapped_type& operator[](const key_type& x); \end{itemdecl} @@ -14983,7 +14982,7 @@ Equivalent to: \tcode{return try_emplace(x).first->second;} \end{itemdescr} -\indexlibrarymember{operator[]}{flatmap}% +\indexlibrarymember{operator[]}{flat_map}% \begin{itemdecl} mapped_type& operator[](key_type&& x); \end{itemdecl} @@ -14994,7 +14993,7 @@ Equivalent to: \tcode{return try_emplace(std::move(x)).first->second;} \end{itemdescr} -\indexlibrarymember{operator[]}{flatmap}% +\indexlibrarymember{operator[]}{flat_map}% \begin{itemdecl} template mapped_type& operator[](K&& x); \end{itemdecl} @@ -15010,7 +15009,7 @@ Equivalent to: \tcode{return try_emplace(std::forward(x)).first->second;} \end{itemdescr} -\indexlibrarymember{at}{flatmap}% +\indexlibrarymember{at}{flat_map}% \begin{itemdecl} mapped_type& at(const key_type& x); const mapped_type& at(const key_type& x) const; @@ -15032,7 +15031,7 @@ Logarithmic. \end{itemdescr} -\indexlibrarymember{at}{flatmap}% +\indexlibrarymember{at}{flat_map}% \begin{itemdecl} template mapped_type& at(const K& x); template const mapped_type& at(const K& x) const; @@ -15065,7 +15064,7 @@ \rSec3[flatmap.modifiers]{Modifiers} -\indexlibrarymember{emplace}{flatmap}% +\indexlibrarymember{emplace}{flat_map}% \begin{itemdecl} template pair emplace(Args&&... args); \end{itemdecl} @@ -15098,7 +15097,7 @@ the element with key equivalent to \tcode{t.first}. \end{itemdescr} -\indexlibrarymember{insert}{flatmap}% +\indexlibrarymember{insert}{flat_map}% \begin{itemdecl} template pair insert(P&& x); template iterator insert(const_iterator position, P&& x); @@ -15111,12 +15110,12 @@ \pnum \effects -The first form is equivalent to \tcode{return emplace(std::forward

(x))}. +The first form is equivalent to \tcode{return emplace(std::forward

(x));}. The second form is equivalent to -\tcode{return emplace_hint(position, std::forward

(x))}. +\tcode{return emplace_hint(position, std::forward

(x));}. \end{itemdescr} -\indexlibrarymember{insert}{flatmap}% +\indexlibrarymember{insert}{flat_map}% \begin{itemdecl} template void insert(InputIterator first, InputIterator last); @@ -15157,7 +15156,7 @@ Since this operation performs an in-place merge, it may allocate memory. \end{itemdescr} -\indexlibrarymember{insert}{flatmap}% +\indexlibrarymember{insert}{flat_map}% \begin{itemdecl} template void insert(sorted_unique_t, InputIterator first, InputIterator last); @@ -15194,7 +15193,7 @@ Since this operation performs an in-place merge, it may allocate memory. \end{itemdescr} -\indexlibrarymember{insert_range}{flatmap}% +\indexlibrarymember{insert_range}{flat_map}% \begin{itemdecl} template<@\exposconcept{container-compatible-range}@ R> void insert_range(R&& rg); @@ -15226,8 +15225,8 @@ \pnum \complexity $N$ + $M \log M$, -where $M$ is \tcode{ranges::distance(range)} and -$N$ is \tcode{size()} before the operation. +where $N$ is \tcode{size()} before the operation and +$M$ is \tcode{ranges::distance(rg)}. \pnum \remarks @@ -15277,7 +15276,7 @@ the same as \tcode{emplace_hint} for the last two overloads. \end{itemdescr} -\indexlibrarymember{try_emplace}{flatmap}% +\indexlibrarymember{try_emplace}{flat_map}% \begin{itemdecl} template pair try_emplace(K&& k, Args&&... args); @@ -15306,7 +15305,7 @@ \expects The conversion from \tcode{k} into \tcode{key_type} constructs an object \tcode{u}, -for which \tcode{find(k) == find(u)} is true. +for which \tcode{find(k) == find(u)} is \tcode{true}. \pnum \effects @@ -15333,7 +15332,7 @@ The same as \tcode{emplace} and \tcode{emplace_hint}, respectively. \end{itemdescr} -\indexlibrarymember{insert_or_assign}{flatmap}% +\indexlibrarymember{insert_or_assign}{flat_map}% \begin{itemdecl} template pair insert_or_assign(const key_type& k, M&& obj); @@ -15378,7 +15377,7 @@ the same as \tcode{emplace_hint} for the last two overloads. \end{itemdescr} -\indexlibrarymember{insert_or_assign}{flatmap}% +\indexlibrarymember{insert_or_assign}{flat_map}% \begin{itemdecl} template pair insert_or_assign(K&& k, M&& obj); @@ -15404,7 +15403,7 @@ \pnum \expects The conversion from \tcode{k} into \tcode{key_type} constructs -an object \tcode{u}, for which \tcode{find(k) == find(u)} is true. +an object \tcode{u}, for which \tcode{find(k) == find(u)} is \tcode{true}. \pnum \effects @@ -15434,7 +15433,7 @@ The same as \tcode{emplace} and \tcode{emplace_hint}, respectively. \end{itemdescr} -\indexlibrarymember{swap}{flatmap}% +\indexlibrarymember{swap}{flat_map}% \begin{itemdecl} void swap(flat_map& y) noexcept; \end{itemdecl} @@ -15450,7 +15449,7 @@ \end{codeblock} \end{itemdescr} -\indexlibrarymember{extract}{flatmap}% +\indexlibrarymember{extract}{flat_map}% \begin{itemdecl} containers extract() &&; \end{itemdecl} @@ -15465,7 +15464,7 @@ \tcode{std::move(c)}. \end{itemdescr} -\indexlibrarymember{replace}{flatmap}% +\indexlibrarymember{replace}{flat_map}% \begin{itemdecl} void replace(key_container_type&& key_cont, mapped_container_type&& mapped_cont); \end{itemdecl} @@ -15488,7 +15487,7 @@ \rSec3[flatmap.erasure]{Erasure} -\indexlibrarymember{erase_if}{flatmap}% +\indexlibrarymember{erase_if}{flat_map}% \begin{itemdecl} template @@ -15530,7 +15529,7 @@ \rSec3[flatmultimap.overview]{Overview} \pnum -\indexlibrary{\idxcode{flatmultimap}}% +\indexlibraryglobal{flat_multimap}% A \tcode{flat_multimap} is a container adaptor that provides an associative container interface that supports equivalent keys @@ -15569,7 +15568,7 @@ in \ref{associative.reqmts} for equal keys. This means that a \tcode{flat_multimap} supports the \tcode{a_eq} operations in \ref{associative.reqmts} but not the \tcode{a_uniq} operations. -For a \tcode{flat_multimap} +For a \tcode{flat_multimap} the \tcode{key_type} is \tcode{Key} and the \tcode{value_type} is \tcode{pair}. @@ -15599,7 +15598,7 @@ If any member function in \ref{flatmultimap.defn} exits via an exception, the invariants are restored. \begin{note} -This can result in the \tcode{flat_multimap}'s being emptied. +This can result in the \tcode{flat_multimap} being emptied. \end{note} \pnum @@ -15607,7 +15606,7 @@ supporting \oldconcept{RandomAccessIterator} can be used to instantiate \tcode{flat_multimap}, as long as invocations of -member functions \tcode{C::size} and \tcode{C::max_size} do not throw. +member functions \tcode{C::size} and \tcode{C::max_size} do not exit via an exception. In particular, \tcode{vector}\iref{vector} and \tcode{deque}\iref{deque} can be used. \begin{note} @@ -15706,17 +15705,17 @@ template<@\exposconcept{container-compatible-range}@ R> flat_mutlimap(from_range_t fr, R&& rg) - : flat_multimap(fr, std::forward(range), key_compare()) { } + : flat_multimap(fr, std::forward(rg), key_compare()) { } template<@\exposconcept{container-compatible-range}@ R, class Allocator> flat_mutlimap(from_range_t, R&& rg, const Allocator& a); template<@\exposconcept{container-compatible-range}@ R> flat_multimap(from_range_t, R&& rg, const key_compare& comp) - : flat_multimap(comp) { insert_range(std::forward(range)); } + : flat_multimap(comp) { insert_range(std::forward(rg)); } template<@\exposconcept{container-compatible-range}@ R, class Allocator> flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); template - flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, + flat_multimap(sorted_equivalent_t s, InputIterator first, InputIterator last, const key_compare& comp = key_compare()) : c(), compare(comp) { insert(s, first, last); } template @@ -15913,12 +15912,12 @@ \pnum The member type \tcode{containers} has the data members and special members -specified above. It has no base classes or members other than those +specified above. It has no base classes or members other than those specified. \rSec3[flatmultimap.cons]{Constructors} -\indexlibraryctor{flatmultimap}% +\indexlibraryctor{flat_multimap}% \begin{itemdecl} flat_multimap(key_container_type key_cont, mapped_container_type mapped_cont); \end{itemdecl} @@ -15939,7 +15938,7 @@ where $N$ is \tcode{key_cont.size()}. \end{itemdescr} -\indexlibraryctor{flatmultimap}% +\indexlibraryctor{flat_multimap}% \begin{itemdecl} template flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, @@ -15963,7 +15962,7 @@ Same as \tcode{flat_multimap(key_cont, mapped_cont)}. \end{itemdescr} -\indexlibraryctor{flatmultimap}% +\indexlibraryctor{flat_multimap}% \begin{itemdecl} flat_multimap(sorted_equivalent_t, key_container_type key_cont, mapped_container_type mapped_cont); \end{itemdecl} @@ -15980,7 +15979,7 @@ Constant. \end{itemdescr} -\indexlibraryctor{flatmultimap}% +\indexlibraryctor{flat_multimap}% \begin{itemdecl} template flat_multimap(sorted_equivalent_t s, const key_container_type& key_cont, @@ -16004,7 +16003,7 @@ Linear. \end{itemdescr} -\indexlibraryctor{flatmultimap}% +\indexlibraryctor{flat_multimap}% \begin{itemdecl} template flat_multimap(const key_compare& comp, const Allocator& a); @@ -16051,7 +16050,7 @@ \rSec3[flatmultimap.erasure]{Erasure} -\indexlibrarymember{erase_if}{flatmultimap}% +\indexlibrarymember{erase_if}{flat_multimap}% \begin{itemdecl} template