|
Boost-Commit : |
From: dgregor_at_[hidden]
Date: 2008-08-19 09:42:03
Author: dgregor
Date: 2008-08-19 09:42:02 EDT (Tue, 19 Aug 2008)
New Revision: 48215
URL: http://svn.boost.org/trac/boost/changeset/48215
Log:
Finish updates to N2691
Text files modified:
sandbox/committee/concepts/stdlib/clib-containers.tex | 160 +++++++++++++++++++++++++++++++--------
1 files changed, 127 insertions(+), 33 deletions(-)
Modified: sandbox/committee/concepts/stdlib/clib-containers.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-containers.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-containers.tex 2008-08-19 09:42:02 EDT (Tue, 19 Aug 2008)
@@ -124,6 +124,8 @@
\tcode{MemberRangeInsertionContainer} concepts, along with a concept
map to adapt from member- to free-function syntax, which is
necessary for \tcode{priority_queue}'s constructors.
+\item Updated the base wording to reflect the changes in N2691,
+ including support for initializer lists and changes to emplace.
\end{itemize}
\end{titlepage}
@@ -239,7 +241,7 @@
\mbox{\tcode{A::inner_allocator_type}} (if any),and
\mbox{\tcode{Args}} denotes a template parameter pack}
-\editorial{Remove Table 88: \mbox{\tcode{ConstructibleAsElement<A, T,
+\editorial{Remove Table 89: \mbox{\tcode{ConstructibleAsElement<A, T,
Args>}} requirements}
\setcounter{Paras}{4}
@@ -253,7 +255,7 @@
an lvalue or a const rvalue of type \tcode{X}, and \tcode{rv}
denotes a non-const rvalue of type \tcode{X}.
-\setcounter{table}{88}
+\setcounter{table}{89}
\begin{libreqtab5}
{Container requirements}
@@ -468,12 +470,12 @@
Those entries marked ``(Note A)'' should have constant complexity.
Those entries marked ``(Note B)'' have constant complexity unless
\changedConcepts{\mbox{\tcode{allocator_propagate_never<X::allocator_type>::value}}
- is \mbox{\tcode{true}}}{\mbox{\tcode{AllocatorPropagateNever<X::allocator_type>}} is satisfied}, in which case they have linear complexity. Those
+ is \mbox{\tcode{true}}}{\\\mbox{\tcode{AllocatorPropagateNever<X::allocator_type>}} is satisfied}, in which case they have linear complexity. Those
entries marked ``(Note C)'' have constant complexity if
\tcode{a.get_allocator() == rv.get_allocator()} or if either
\changedConcepts{\mbox{\tcode{allocator_propagate_on_move_assignment<X::allocator_type>::value}}
- is \mbox{\tcode{true}}}{\mbox{\tcode{AllocatorPropagateOnMoveAssignment<X::allocator>}} is satisfied} or \changedConcepts{\mbox{\tcode{allocator_propagate_on_copy_assignment<X::allocator_type>::value}} is
- \mbox{\tcode{true}}}{\mbox{\tcode{AllocatorPropagateOnCopyAssignment<X::allocator>}} is satisfied} and linear complexity otherwise.
+ is \mbox{\tcode{true}}}{\\\mbox{\tcode{AllocatorPropagateOnMoveAssignment<X::allocator>}} is satisfied} or \changedConcepts{\\\mbox{\tcode{allocator_propagate_on_copy_assignment<X::allocator_type>::value}} is
+ \mbox{\tcode{true}}}{\mbox{\\\tcode{AllocatorPropagateOnCopyAssignment<X::allocator>}} is satisfied} and linear complexity otherwise.
\setcounter{Paras}{8}
\pnum
@@ -504,7 +506,7 @@
\pnum
The complexities of the expressions are sequence dependent.
-\setcounter{table}{91}
+\setcounter{table}{92}
\begin{libreqtab3}
{Sequence container requirements (in addition to container)}
@@ -531,8 +533,14 @@
Each iterator in the range \range{i}{j} shall be dereferenced exactly once.\br
post: \tcode{size() == distance}\ between \tcode{i}\ and \tcode{j}\br
Constructs a sequence container equal to the range \tcode{[i, j)} \\ \rowsep
-
-\tcode{a.emplace(p, args);} &
+\tcode{X(il)} &
+ &
+Equivalent to \tcode{X(il.begin(), il.end())} \\ \rowsep
+\tcode{a = il} &
+\tcode{X\&} &
+\tcode{a = il;}\br
+\tcode{return *this;} \\ \rowsep
+\tcode{a.emplace(p, args)} &
\tcode{iterator} &
\removedConcepts{\mbox{\requires} \mbox{\tcode{ConstructibleAsElement<A,}} \mbox{\tcode{T, Args>}}.}
Inserts an object of type \tcode{T} constructed with
@@ -540,7 +548,7 @@
\tcode{a.insert(p,t)} &
\tcode{iterator} &
- \removedConcepts{\mbox{\requires} \mbox{\tcode{ConstructibleAsElement<A,}} \mbox{\tcode{T, Args>}}
+ \removedConcepts{\mbox{\requires} \mbox{\tcode{ConstructibleAsElement<A,}} \mbox{\tcode{T, T>}}
and \mbox{\tcode{T}} shall be \mbox{\tcode{CopyAssignable}}.}\br
Inserts a copy of \tcode{t}\ before \tcode{p}. \\ \rowsep
@@ -557,12 +565,16 @@
\tcode{a.insert(p,i,j)} &
\tcode{void} &
-\mbox{\requires} \removedConcepts{If the iterator's dereference operation returns an
+\removedConcepts{\mbox{\requires} If the iterator's dereference operation returns an
lvalue or a const rvalue, \mbox{\tcode{T}} shall be \mbox{\tcode{CopyConstructible}}.}
Each iterator in the range \range{i}{j} shall be dereferenced exactly once.\br
pre: \tcode{i}\ and \tcode{j}\ are not iterators into \tcode{a}.\br
Inserts copies of elements in \tcode{[i, j)} before \tcode{p} \\ \rowsep
+\tcode{a.insert(p, il)} &
+\tcode{void} &
+\tcode{a.insert(p, il.begin(), il.end())} \\ \rowsep
+
\tcode{a.erase(q)} &
\tcode{iterator} &
\removedConcepts{\mbox{\requires} \mbox{\tcode{T}} shall be \mbox{\tcode{MoveAssignable}}.}
@@ -587,6 +599,10 @@
pre: \tcode{i}, \tcode{j}\ are not iterators into \tcode{a}.\br
Replaces elements in \tcode{a}\ with a copy of \tcode{[i, j)}. \\ \rowsep
+\tcode{a.assign(il)} &
+\tcode{void} &
+\tcode{a.assign(il.begin(), il.end())} \\ \rowsep
+
\tcode{a.assign(n,t)} &
\tcode{void} &
\removedConcepts{\mbox{\requires} \mbox{\tcode{T}} shall be \mbox{\tcode{CopyConstructible}}
@@ -630,18 +646,42 @@
\tcode{ return *tmp; \}} &
\tcode{vector}, \tcode{list}, \tcode{deque}, \tcode{basic_string}\\ \rowsep
-\tcode{a.push_-} \tcode{front(args)} &
+\tcode{a.emplace_-} \tcode{front(args)} &
\tcode{void} &
\tcode{a.emplace(a.begin(),} \tcode{std::forward<Args>(args)...)}
\removedConcepts{\mbox{\requires} \mbox{\tcode{ConstructibleAsElement<A,}} \mbox{\tcode{T, Args>}}} &
\tcode{list}, \tcode{deque} \\ \rowsep
-\tcode{a.push_-} \tcode{back(args)} &
+\tcode{a.emplace_-} \tcode{back(args)} &
\tcode{void} &
\tcode{a.emplace(a.end(),} \tcode{std::forward<Args>(args)...)}
\removedConcepts{\mbox{\requires} \mbox{\tcode{ConstructibleAsElement<A,}} \mbox{\tcode{T, Args>}}} &
\tcode{list}, \tcode{deque}, \tcode{vector} \\ \rowsep
+\tcode{a.push_-} \tcode{front(t)} &
+\tcode{void} &
+\tcode{a.insert(a.begin(), t)}\br
+\removedConcepts{\mbox{\requires} \mbox{\tcode{ConstructibleAsElement<A,}} \mbox{\tcode{T, T>}} and \mbox{\tcode{T}} shall be \mbox{\tcode{CopyAssignable}}.} &
+\tcode{list}, \tcode{deque} \\ \rowsep
+
+\tcode{a.push_-} \tcode{front(rv)} &
+\tcode{void} &
+\tcode{a.insert(a.begin(), rv)}\br
+\removedConcepts{\mbox{\requires} \mbox{\tcode{ConstructibleAsElement<A,}} \mbox{\tcode{T, T\&\&>}} and \mbox{\tcode{T}} shall be \mbox{\tcode{MoveAssignable}}.} &
+\tcode{list}, \tcode{deque} \\ \rowsep
+
+\tcode{a.push_-} \tcode{back(t)} &
+\tcode{void} &
+\tcode{a.insert(a.end(), t)}\br
+\removedConcepts{\mbox{\requires} \mbox{\tcode{ConstructibleAsElement<A,}} \mbox{\tcode{T, T>}} and \mbox{\tcode{T}} shall be \mbox{\tcode{CopyAssignable}}.} &
+\tcode{vector}, \tcode{list}, \tcode{deque}, \tcode{basic_string} \\ \rowsep
+
+\tcode{a.push_-} \tcode{back(rv)} &
+\tcode{void} &
+\tcode{a.insert(a.end(), rv)}\br
+\removedConcepts{\mbox{\requires} \mbox{\tcode{ConstructibleAsElement<A,}} \mbox{\tcode{T, T\&\&>}} and \mbox{\tcode{T}} shall be \mbox{\tcode{MoveAssignable}}.} &
+\tcode{vector}, \tcode{list}, \tcode{deque}, \tcode{basic_string} \\ \rowsep
+
\tcode{a.pop_front()} &
\tcode{void} &
\tcode{a.erase(a.begin())} &
@@ -5086,10 +5126,10 @@
map(const map&, const Alloc@\removedConcepts{ator}@&);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, value_type\&\&>}@
map(map&&, const Alloc@\removedConcepts{ator}@&);
- @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
- map(initializer_list<value_type>,
- const Compare& = Compare(),
- const Allocator& = Allocator());
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ map(initializer_list<value_type>,
+ const Compare& = Compare(),
+ const Allocator& = Allocator());
~map();
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
@\addedConcepts{\&\& CopyAssignable<value_type>}@
@@ -5555,10 +5595,10 @@
multimap(const multimap&, const Alloc@\removedConcepts{ator}@&);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, value_type\&\&>}@
multimap(multimap&&, const Alloc@\removedConcepts{ator}@&);
- @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
- multimap(initializer_list<value_type>,
- const Compare& = Compare(),
- const Allocator& = Allocator());
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ multimap(initializer_list<value_type>,
+ const Compare& = Compare(),
+ const Allocator& = Allocator());
~multimap();
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
@\addedConcepts{\&\& CopyAssignable<value_type>}@
@@ -5907,10 +5947,10 @@
set(const set&, const Alloc@\removedConcepts{ator}@&);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, value_type\&\&>}@
set(set&&, const Alloc@\removedConcepts{ator}@&);
- @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
- set(initializer_list<value_type>,
- const Compare& = Compare(),
- const Allocator& = Allocator());
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ set(initializer_list<value_type>,
+ const Compare& = Compare(),
+ const Allocator& = Allocator());
~set();
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
@@ -6187,10 +6227,10 @@
multiset(const multiset&, const Alloc@\removedConcepts{ator}@&);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, value_type\&\&>}@
multiset(multiset&&, const Alloc@\removedConcepts{ator}@&);
- @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
- multiset(initializer_list<value_type>,
- const Compare& = Compare(),
- const Allocator& = Allocator());
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ multiset(initializer_list<value_type>,
+ const Compare& = Compare(),
+ const Allocator& = Allocator());
~multiset();
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&> \&\& CopyAssignable<value_type>}@
multiset<Key,Compare,Alloc@\removedConcepts{ator}@>& operator=(const multiset<Key,Compare,Alloc@\removedConcepts{ator}@>& x);
@@ -6227,7 +6267,7 @@
iterator emplace(Args&&... args);
template <class... Args>
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, Args\&\&...>}@
- iterator emplace(const_iterator position, Args&&... args);
+ iterator emplace_hint(const_iterator position, Args&&... args);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
iterator insert(const value_type& x);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, value_type\&\&>}@
@@ -6546,9 +6586,17 @@
unordered_map(const unordered_map&, const Alloc@\removedConcepts{ator}@&);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, value_type\&\&>}@
unordered_map(unordered_map&&, const Alloc@\removedConcepts{ator}@&);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ unordered_map(initializer_list<value_type>,
+ size_type = @\impdef@,
+ const hasher& hf = hasher(),
+ const key_equal& eql = key_equal(),
+ const allocator_type& a = allocator_type());
~unordered_map();
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&> \&\& CopyAssignable<value_type>}@
unordered_map& operator=(const unordered_map&);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&> \&\& CopyAssignable<value_type>}@
+ unordered_map& operator=(initializer_list<value_type>);
allocator_type get_allocator() const;
// size and capacity
@@ -6578,7 +6626,8 @@
template <@\changedConcepts{class InputIterator}{InputIterator Iter}@>
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, Iter::reference> \&\& MoveConstructible<value_type>}@
void insert(@\changedConcepts{InputIterator}{Iter}@ first, @\changedConcepts{InputIterator}{Iter}@ last);
-
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ void insert(initializer_list<value_type>);
iterator erase(const_iterator position);
size_type erase(const key_type& k);
iterator erase(const_iterator first, const_iterator last);
@@ -6600,6 +6649,8 @@
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const key_type\&, mapped_type\&\&>}@
@\addedConcepts{\&\& ConstructibleAsElement<Alloc, mapped_type>}@
mapped_type& operator[](const key_type& k);
+ mapped_type& at(const key_type& k);
+ const mapped_type& at(const key_type& k) const;
// bucket interface
size_type bucket_count() const;
@@ -6699,6 +6750,19 @@
is the (unique) element whose key is equivalent to \tcode{\textit{k}}.
\end{itemdescr}
+\begin{itemdecl}
+mapped_type& at(const key_type& k);
+const mapped_type& at(const key_type& k) const;
+\end{itemdecl}
+
+\begin{itemdescr}
+\pnum
+\returns\ A reference to \tcode{x.second}, where \tcode{x} is the (unique) element whose key is equivalent to \tcode{k}.
+
+\pnum
+\throws An exception object of type \tcode{out_of_range} if no such element is present.
+\end{itemdescr}
+
\rSec3[unord.map.swap]{\tcode{unordered_map} swap}
\index{unordered_map@\tcode{unordered_map}!swap@\tcode{swap}}%
@@ -6789,9 +6853,17 @@
unordered_multimap(const unordered_multimap&, const Alloc@\removedConcepts{ator}@&);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, value_type\&\&>}@
unordered_multimap(unordered_multimap&&, const Alloc@\removedConcepts{ator}@&);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ unordered_multimap(initializer_list<value_type>,
+ size_type = @\impdef@,
+ const hasher& hf = hasher(),
+ const key_equal& eql = key_equal(),
+ const allocator_type& a = allocator_type());
~unordered_multimap();
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&> \&\& CopyAssignable<value_type>}@
unordered_multimap& operator=(const unordered_multimap&);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&> \&\& CopyAssignable<value_type>}@
+ unordered_multimap& operator=(initializer_list<value_type>);
allocator_type get_allocator() const;
// size and capacity
@@ -6813,7 +6885,7 @@
iterator emplace(Args&&... args);
template <class... Args>
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, Args\&\&...>}@
- iterator emplace(const_iterator position, Args&&... args);
+ iterator emplace_hint(const_iterator position, Args&&... args);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
iterator insert(const value_type& obj);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
@@ -6821,6 +6893,8 @@
template <@\changedConcepts{class InputIterator}{InputIterator Iter}@>
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, Iter::reference> \&\& MoveConstructible<value_type>}@
void insert(@\changedConcepts{InputIterator}{Iter}@ first, @\changedConcepts{InputIterator}{Iter}@ last);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ void insert(initializer_list<value_type>);
iterator erase(const_iterator position);
size_type erase(const key_type& k);
@@ -7004,9 +7078,17 @@
unordered_set(const unordered_set&, const Alloc@\removedConcepts{ator}@&);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, value_type\&\&>}@
unordered_set(unordered_set&&, const Alloc@\removedConcepts{ator}@&);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ unordered_set(initializer_list<value_type>,
+ size_type = @\impdef@,
+ const hasher& hf = hasher(),
+ const key_equal& eql = key_equal(),
+ const allocator_type& a = allocator_type());
~unordered_set();
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&> \&\& CopyAssignable<value_type>}@
unordered_set& operator=(const unordered_set&);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&> \&\& CopyAssignable<value_type>}@
+ unordered_set& operator=(initializer_list<value_type>);
allocator_type get_allocator() const;
// size and capacity
@@ -7028,7 +7110,7 @@
pair<iterator, bool> emplace(Args&&... args);
template <class... Args>
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, Args\&\&...>}@
- iterator emplace(const_iterator position, Args&&... args);
+ iterator emplace_hint(const_iterator position, Args&&... args);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
std::pair<iterator, bool> insert(const value_type& obj);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
@@ -7036,6 +7118,8 @@
template <@\changedConcepts{class InputIterator}{InputIterator Iter}@>
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, Iter::reference> \&\& MoveConstructible<value_type>}@
void insert(@\changedConcepts{InputIterator}{Iter}@ first, @\changedConcepts{InputIterator}{Iter}@ last);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ void insert(initializer_list<value_type>);
iterator erase(const_iterator position);
size_type erase(const key_type& k);
@@ -7218,9 +7302,17 @@
unordered_multiset(const unordered_multiset&, const Alloc@\removedConcepts{ator}@&);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, value_type\&\&>}@
unordered_multiset(unordered_multiset&&, const Alloc@\removedConcepts{ator}@&);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ unordered_multiset(initializer_list<value_type>,
+ size_type = @\impdef@,
+ const hasher& hf = hasher(),
+ const key_equal& eql = key_equal(),
+ const allocator_type& a = allocator_type());
~unordered_multiset();
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&> \&\& CopyAssignable<value_type>}@
unordered_multiset& operator=(const unordered_multiset&);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&> \&\& CopyAssignable<value_type>}@
+ unordered_multiset& operator=(initializer_list<value_type>);
allocator_type get_allocator() const;
// size and capacity
@@ -7242,7 +7334,7 @@
iterator emplace(Args&&... args);
template <class... Args>
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, Args\&\&...>}@
- iterator emplace(const_iterator position, Args&&... args);
+ iterator emplace_hint(const_iterator position, Args&&... args);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
iterator insert(const value_type& obj);
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
@@ -7250,6 +7342,8 @@
template <@\changedConcepts{class InputIterator}{InputIterator Iter}@>
@\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, Iter::value_type> \&\& MoveConstructible<value_type>}@
void insert(@\changedConcepts{InputIterator}{Iter}@ first, @\changedConcepts{InputIterator}{Iter}@ last);
+ @\addedConcepts{requires ConstructibleAsElement<Alloc, value_type, const value_type\&>}@
+ void insert(initializer_list<value_type>);
iterator erase(const_iterator position);
size_type erase(const key_type& k);
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk