﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>N3187 - More on noexcept for the Containers Library</title>

  <style type="text/css">
    p {text-align:justify}
    li {text-align:justify}
    ins {background-color:#A0FFA0}
    del {background-color:#FF6666}
    
    tr.TITLE_ROW {text-align: center; font-weight: bold}
    tr.DELETED {background: #FF6666; text-decoration: line-through}
    tr.INSERTED {background: #FFFF99}
  </style>

  </head>

  <body>
<address>Document number: N3187=10-0177<br/>
  Date: 2010-11-26<br/>
  J. Daniel Garcia<br/>
  Project: Programming Language C++, Library Working Group<br />
  Reply To: <a href="mailto:josedaniel.garcia@uc3m.es">josedaniel.garcia@uc3m.es</a>
</address>
 
<hr/>

<h1>N3187 - More on noexcept for the Containers Library</h1>

<p>This paper studies possible changes to the Containers Library to make broad use of noexcept. The paper 
addresses National Body comments CH 16 and GB 60.</p>

<p>
Changes in this paper are <b>restricted to chapter 23</b> (containers library).
</p>

<p>
All changes in this paper are relative to N3126
</p>

<h2>Discussion</h2>

<h3>Array</h3>

<p>Function <tt>swap()</tt> on arrays may throw only if the corresponding member function from <tt>array</tt> may throw. It has been made conditionally
<tt>noexcept</tt>.</p>

<p>Tuple interface functions for class <tt>array</tt> cannot throw as they return a reference to a position which is known to exist at compile-time.</p>

<p>Member function <tt>swap()</tt> cannot throw unless the member-wise swap throws an exception (23.3.1.6/2). Thus, it has been made 
conditionally <tt>noexcept</tt>.</p>

<p>Iterator functions (<tt>begin()</tt>, <tt>end()</tt> and so on) cannot throw in any case (23.2.1/11), because copying an iterator cannot throw.</p>

<p>Member function <tt>empty</tt> cannot throw. It depends on iterator comparison which cannot throw for library provided iterators. Member function
<tt>max_size</tt> cannot throw as it just computes the size of the largest container.</p>

<p>Operator <tt>[]</tt> cannot throw as it simply de-references a pointer.</p>

<p>Member function <tt>at()</tt> has not been made <tt>noexcept</tt> as it may throw.</p>

<p>Member functions <tt>front()</tt> and <tt>back()</tt> have been made <tt>noexcept</tt> as they simply de-reference a pointer.</p>

<p>Member function <tt>data()</tt> simply gives access to the internal array returning a pointer and cannot throw</p>

<h3>Other sequence containers</h3>

<p>All constructors may throw as they are very likely to allocate memory. This is the case for all the member functions imlpying some insertion as <tt>assign()</tt>, <tt>resize()</tt>, <tt>shrink_to_fit</tt>, <tt>insert</tt>, <tt>push_front</tt>,
and <tt>push_back</tt>.</p>

<p>All destructors have been made <tt>noexcept</tt> as they cannot throw per general rules in the library</p>

<p>Member function <tt>get_allocator</tt> may be made noexcept because any allocator satisfying allocator requirements cannot throw when copying and/or moving.
This has been also applied to all iterator acces member functions.</p>

<p>Member function <tt>empty</tt> cannot throw. It depends on iterator comparison which cannot throw for library provided iterators. Member function
<tt>max_size</tt> cannot throw as it just computes the size of the largest container.</p>

<p>For member function <tt>clear</tt> application of clause 23.2.1/11 follows that it must be made <tt>noexcept</tt>.</p>

<p>Function <tt>swap()</tt> has to consider several factors. First, it shall exchange values without invoking
any move, copy or swap on individual elements. Second, if 
<tt>allocator_traits<deque>::propagate_on_container_swap::value</tt> is <tt>true</tt>, then allocators from
<tt>a</tt> and <tt>b</tt> shall be exchanged by means of non-member <tt>swap</tt>. However, swapping allocators
cannot throw. Third, <tt>swap()</tt> cannot throw for <tt>deque</tt> as established per 23.2.1/11. Thus,
<tt>swap</tt> has been mad <tt>noexcept</tt>.</p>

<h3>Additional members for vector</h3>

<p>Access through <tt>operator[]</tt> has been made <tt>noexcept</tt>.

<h3>Container Adaptors</h3>

<p>For container adaptors most members cannot be made noexcept without providing a condition based on the user provided container. However some members 
have been made noexcept.</p>

<p>Conditionally <tt>noexcept</tt> members include move constructors, move assignment operators and <tt>swap()</tt>.

<h3>Associative containers</h3>

<p>Function <tt>swap()</tt> on associative containers if the corresponding container <tt>swap()</tt> member function may throw. It has been made
conditionally <tt>noexcept</tt>.

<p>For member functions, all the reasoning applied to sequence container has been applied here too, with the exception of member function <tt>swap()</tt>.
This member function must be made here conditionally noexcept as it relies on <tt>swap()</tt> for key comparator.

<h2>Open points</h2>

Container adaptors do not specifically require that it <tt>Container</tt> template parameter satisfies the <em>Container</em> requirements. This gives
no exception guarantees at all. I think this to be incorrect as it does not provide any semantic guarantee on the <em>container being adapted</em>. 
However, this is a potentially breaking change that must be carefully analyzed. In the meantime, this paper currently proposes to make <tt>swap()</tt>
member function conditionally <tt>noexcept</tt>.

<h2>Acknowledments</h2>

I am very grateful to Daniel Kr&uuml;gler for reviewing this paper.


<h1>Proposed Wording</h1>

<h3>23.2.1 General container requirements [container.requirements.general]</h3>

After p.2 add:
<p><ins>? All standard containers will have their destructor's <em>noexcept-specification</em> deduced to <tt>noexcept(true)</tt>.</ins></p>

<h3>23.3 Sequence containers [sequences]</h3>

After p. 1
<pre>
namespace std {
  #include &lt;initializer_list&gt;

...
  template &lt;class T, size_t N &gt;
    void swap(array&lt;T,N&gt;&amp; x, array&lt;T,N&gt;&amp; y)<ins>noexcept(noexcept(x.swap(y)))</ins>;

  template &lt;class T&gt; class tuple_size;
  template &lt;size_t I, class T&gt; class tuple_element;
  template &lt;class T, size_t N&gt;
    struct tuple_size&lt;array&lt;T, N&gt; &gt;;
  template &lt;size_t I, class T, size_t N&gt;
    struct tuple_element&lt;I, array&lt;T, N&gt; &gt;;
  template &lt;size_t I, class T, size_t N&gt;
    T&amp; get(array&lt;T, N&gt;&amp;)<ins> noexcept</ins>;
  template &lt;size_t I, class T, size_t N&gt;
    const T&amp; get(const array&lt;T, N&gt;&amp;)<ins> noexcept</ins>;
}
</pre>

<h3>23.3.1 Class template array [array]</h3>

After p. 3
<pre>
namespace std {
  template &lt;class T, size_t N &gt;
  struct array {
...

    // No explicit construct/copy/destroy for aggregate type
...
    void swap(array<T, N>&amp;<ins> x</ins>)<ins> noexcept(noexcept(swap(elems[0], x.elems[0])))</ins>;

    // iterators:
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;
    reverse_iterator rbegin()<ins> noexcept</ins>;
    const_reverse_iterator rbegin() const<ins> noexcept</ins>;
    reverse_iterator rend()<ins> noexcept</ins>;
    const_reverse_iterator rend() const<ins> noexcept</ins>;
    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;
    const_reverse_iterator crbegin() const<ins> noexcept</ins>;
    const_reverse_iterator crend() const<ins> noexcept</ins>;

    // capacity:
    constexpr size_type size()<ins> noexcept</ins>;
    constexpr size_type max_size()<ins> noexcept</ins>;
    constexpr bool empty()<ins> noexcept</ins>;

    // element access:
    reference operator[](size_type n)<ins> noexcept</ins>;
    const_reference operator[](size_type n) const<ins> noexcept</ins>;
    const_reference at(size_type n) const;
    reference at(size_type n);
    reference front()<ins> noexcept</ins>;
    const_reference front() const<ins> noexcept</ins>;
    reference back()<ins> noexcept</ins>;
    const_reference back() const<ins> noexcept</ins>;
    T * data()<ins> noexcept</ins>;
    const T * data() const<ins> noexcept</ins>;
  };
}
</pre>

<h3>23.3.1.2 array specialized algorithms [array.special]</h3>

Before p. 1
<pre>
template &lt;class T, size_t N&gt; void swap(array&lt;T,N&gt;&amp; x, array&lt;T,N&gt;&amp; y)<ins>
  noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.3.1.3 array::size [array.size]</h3>

Before p. 1
<pre>template &lt;class T, size_t N&gt; constexpr size_type array&lt;T,N&gt;::size()<ins> noexcept</ins>;</pre>

<h3>23.3.1.4 array::data [array.data]</h3>

Before p. 1
<pre>
T *data()<ins> noexcept</ins>;
const T *data() const<ins> noexcept</ins>;
</pre>

<h3>23.3.1.6 array::swap [array.swap]</h3>

Before p. 1
<pre>void swap(array&amp; y)<ins> noexcept(noexcept(swap(declval&lt;T&amp;&gt;(), declval&lt;T&amp;&gt;)))</ins>;</pre>

<h3>23.3.1.7 Zero sized arrays [array.zero]</h3>

After p.3
<p><ins>? Member function <tt>swap()</tt> will have a <em>noexcept-specification</em> which is equivalent to <tt>noexcept(true)</tt>.</ins></p>

<h3>23.3.1.8 Tuple interface to class template array [array.tuple]</h3>

After p. 4
<pre>template &lt;size_t I, class T, size_t N&gt; T&amp; get(array&lt;T, N&gt;&amp; a)<ins> noexcept</ins>;</pre>

After p. 7
<pre>template &lt;size_t I, class T, size_t N&gt; const T&amp; get(const array&lt;T, N&gt;&amp; a)<ins> noexcept</ins>;</pre>

<h3>23.3.2 Class template deque [deque]</h3>

After p. 2
<pre>
namespace std {
  template &lt;class T, class Allocator = allocator&lt;T&gt; &gt;
  class deque {
    public:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;
    
    // iterators:
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;
    reverse_iterator rbegin()<ins> noexcept</ins>;
    const_reverse_iterator rbegin() const<ins> noexcept</ins>;
    reverse_iterator rend()<ins> noexcept</ins>;
    const_reverse_iterator rend() const<ins> noexcept</ins>;
    
    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;
    const_reverse_iterator crbegin() const<ins> noexcept</ins>;
    const_reverse_iterator crend() const<ins> noexcept</ins>;
    
    // 23.3.2.2 capacity:
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;
    void resize(size_type sz);
    void resize(size_type sz, const T&amp; c);
    void shrink_to_fit();
    bool empty() const<ins> noexcept</ins>;
    
    // element access:
    reference operator[](size_type n)<ins> noexcept</ins>;
    const_reference operator[](size_type n) const<ins> noexcept</ins>;
...
    
    // 23.3.2.3 modifiers:
...
    void pop_front()<ins> noexcept</ins>;
    void pop_back()<ins> noexcept</ins>;
...
    void swap(deque&lt;T,Allocator&gt;&amp;)<ins> noexcept</ins>;
    void clear()<ins> noexcept</ins>;
};

...
  // specialized algorithms:
  template &lt;class T, class Allocator&gt;
    void swap(deque&lt;T,Allocator&gt;&amp; x, deque&lt;T,Allocator&gt;&amp; y)<ins> noexcept</ins>;
}
</pre>

<h3>23.3.2.4 deque specialized algorithms [deque.special]</h3>

Before p. 1
<pre>
template &lt;class T, class Allocator&gt;
  void swap(deque&lt;T,Allocator&gt;&amp; x, deque&lt;T,Allocator&gt;&amp; y)<ins> noexcept</ins>;
</pre>

<h3>23.3.3 Class template forward_list [forwardlist]</h3>

After p. 3
<pre>
namespace std {
  template &lt;class T, class Allocator = allocator&lt;T&gt; &gt;
  class forward_list {
...
    allocator_type get_allocator() const<ins> noexcept</ins>;
...
    // 23.3.3.2 iterators:
    iterator before_begin()<ins> noexcept</ins>;
    const_iterator before_begin() const<ins> noexcept</ins>;
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;

    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cbefore_begin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;

    // capacity:
    bool empty() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;

...
    // 23.3.3.4 modifiers:
    template &lt;class... Args&gt; void emplace_front(Args&amp;&amp;... args);
    void push_front(const T&amp; x);
    void push_front(T&amp;&amp; x);
    void pop_front()<ins> noexcept</ins>;
...
    void swap(forward_list&lt;T,Allocator&gt;&amp;)<ins> noexcept</ins>;

    void resize(size_type sz);
    void resize(size_type sz, value_type c);
    void clear()<ins> noexcept</ins>;
...
  };

...
  // 23.3.3.6 specialized algorithms:
  template &lt;class T, class Allocator&gt;
    void swap(forward_list&lt;T,Allocator&gt;&amp; x, forward_list&lt;T,Allocator&gt;&amp; y)<ins> noexcept</ins>;

}
</pre>

<h3>23.3.3.2 forward_list iterators [forwardlist.iter]</h3>

Before p. 1
<pre>
iterator before_begin()<ins> noexcept</ins>;
const_iterator before_begin() const<ins> noexcept</ins>;
const_iterator cbefore_begin() const<ins> noexcept</ins>;
</pre>

<h3>23.3.3.4 forward_list modifiers [forwardlist.modifiers]</h3>

After p. 3
<pre>void pop_front()<ins> noexcept</ins>;</pre>

After p. 27
<pre>void clear()<ins> noexcept</ins>;</pre>

<h3>23.3.3.6 forward_list specialized algorithms [forwardlist.spec]</h3>

Before p. 1
<pre>
template &lt;class T, class Allocator&gt;
  void swap(forward_list&lt;T,Allocator&gt;&amp; x, forward_list&lt;T,Allocator&gt;&amp; y)<ins> noexcept</ins>;
</pre>

<h3>23.3.4 Class template list [list]</h3>

After p. 3
<pre>
namespace std {
  template &lt;class T, class Allocator = allocator&lt;T&gt; &gt;
  class list {
  public:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // iterators:
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;
    reverse_iterator rbegin()<ins> noexcept</ins>;
    const_reverse_iterator rbegin() const<ins> noexcept</ins>;
    reverse_iterator rend()<ins> noexcept</ins>;
    const_reverse_iterator rend() const<ins> noexcept</ins>;
    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;
    const_reverse_iterator crbegin() const<ins> noexcept</ins>;
    const_reverse_iterator crend() const<ins> noexcept</ins>;

    // 23.3.4.2 capacity:
    bool empty() const<ins> noexcept</ins>;
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;
    void resize(size_type sz);
    void resize(size_type sz, const T&amp; c);
...
    // 23.3.4.3 modifiers:
...
    void swap(list&lt;T,Allocator&gt;&amp;)<ins> noexcept</ins>;
    void clear()<ins> noexcept</ins>;
...
  };
...
  // specialized algorithms:
  template &lt;class T, class Allocator&gt;
    void swap(list&lt;T,Allocator&gt;&amp; x, list&lt;T,Allocator&gt;&amp; y)<ins> noexcept</ins>;

}
</pre>

<h3>23.3.4.5 list specialized algorithms [list.special]</h3>

Before p. 1
<pre>
template &lt;class T, class Allocator&gt;
  void swap(list&lt;T,Allocator&gt;&amp; x, list&lt;T,Allocator&gt;&amp; y)<ins> noexcept</ins>;
</pre>

<h3>23.4.1 Class template vector [vector]</h3>

After p. 3
<pre>
namespace std {
  template &lt;class T, class Allocator = allocator&lt;T&gt; &gt;
  class vector {
    public:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // iterators:
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;
    reverse_iterator rbegin()<ins> noexcept</ins>;
    const_reverse_iterator rbegin() const<ins> noexcept</ins>;
    reverse_iterator rend()<ins> noexcept</ins>;
    const_reverse_iterator rend() const<ins> noexcept</ins>;

    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;
    const_reverse_iterator crbegin() const<ins> noexcept</ins>;
    const_reverse_iterator crend() const<ins> noexcept</ins>;

    // 23.4.1.2 capacity:
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;
    void resize(size_type sz);
    void resize(size_type sz, const T&amp; c);
    size_type capacity() const<ins> noexcept</ins>;
    bool empty() const<ins> noexcept</ins>;
    void reserve(size_type n);
    void shrink_to_fit();

    // element access:
    reference operator[](size_type n)<ins> noexcept</ins>;
    const_reference operator[](size_type n) const<ins> noexcept</ins>;
    const_reference at(size_type n) const;
    reference at(size_type n);
...
    // 23.4.1.4 modifiers:
...
    void pop_back()<ins> noexcept</ins>;
...
    void swap(vector&lt;T,Allocator&gt;&amp;)<ins> noexcept</ins>;
    void clear()<ins> noexcept</ins>;
  };
...
  // specialized algorithms:
  template &lt;class T, class Allocator&gt;
    void swap(vector&lt;T,Allocator&gt;&amp; x, vector&lt;T,Allocator&gt;&amp; y)<ins> noexcept</ins>;

}
</pre>

<h3>23.4.1.2 vector capacity [vector.capacity]</h3>

Before p. 1
<pre>size_type capacity() const<ins> noexcept</ins>;</pre>

After p. 6
<pre>void swap(vector&lt;T,Allocator&gt;&amp; x)<ins> noexcept</ins>;</pre>

<h3>23.4.1.5 vector specialized algorithms [vector.special]</h3>

Before p. 1
<pre>
template &lt;class T, class Allocator&gt;
  void swap(vector&lt;T,Allocator&gt;&amp; x, vector&lt;T,Allocator&gt;&amp; y)<ins> noexcept</ins>;
</pre>

<h3>23.4.2 Class vector<bool> [vector.bool]</h3>

After p. 1
<pre>
namespace std {
  template &lt;class Allocator&gt; class vector&lt;bool, Allocator&gt; {
  public:
...
    // bit reference:
    class reference {
      friend class vector;
      reference()<ins> noexcept</ins>;
    public:
      ~reference()<ins> noexcept</ins>;
      operator bool() const<ins> noexcept</ins>;
      reference&amp; operator=(const bool x)<ins> noexcept</ins>;
      reference&amp; operator=(const reference&amp; x)<ins> noexcept</ins>;
      void flip()<ins> noexcept</ins>; // flips the bit
    };

...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // iterators:
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;
    reverse_iterator rbegin()<ins> noexcept</ins>;
    const_reverse_iterator rbegin() const<ins> noexcept</ins>;
    reverse_iterator rend()<ins> noexcept</ins>;
    const_reverse_iterator rend() const<ins> noexcept</ins>;

    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;
    const_reverse_iterator crbegin() const<ins> noexcept</ins>;
    const_reverse_iterator crend() const<ins> noexcept</ins>;

    // capacity:
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;
    void resize(size_type sz, bool c = false);
    size_type capacity() const<ins> noexcept</ins>;
    bool empty() const<ins> noexcept</ins>;
    void reserve(size_type n);
    void shrink_to_fit();

   // element access:
    reference operator[](size_type n)<ins> noexcept</ins>;
    const_reference operator[](size_type n) const<ins> noexcept</ins>;
    const_reference at(size_type n) const;
    reference at(size_type n);
...

    // modifiers:
...
    void pop_back()<ins> noexcept</ins>;
...
    iterator erase(const_iterator position)<ins> noexcept</ins>;
    iterator erase(const_iterator first, const_iterator last)<ins> noexcept</ins>;
    void swap(vector&lt;T,Allocator&gt;&amp;)<ins> noexcept</ins>;
    static void swap(reference x, reference y)<ins> noexcept</ins>;
    void flip()<ins> noexcept</ins>; // flips all bits
    void clear()<ins> noexcept</ins>;
  };
</pre>

After p. 4
<pre>void flip()<ins> noexcept</ins>;</pre>

After p. 5
<pre>static void swap(reference x, reference y)<ins> noexcept</ins>;</pre>

<h3>23.5.1.1 queue definition [queue.defn]</h3>

<pre>
namespace std {
  template &lt;class T, class Container = deque&lt;T&gt; &gt;
  class queue {
  public:
...
    explicit queue(Container&amp;&amp; = Container())<ins> noexcept(<em>see below</em>)</ins>;
    queue(queue&amp;&amp; q)<ins> noexcept(<em>see below</em>)</ins>;
...
    template &lt;class Alloc&gt; queue(Container&amp;&amp;, const Alloc&amp;)<ins> noexcept(<em>see below</em>)</ins>;
...
    template &lt;class Alloc&gt; queue(queue&amp;&amp;, const Alloc&amp;)<ins> noexcept(<em>see below</em>)</ins>;
    queue&amp; operator=(queue&amp;&amp; q)<ins> noexcept(<em>see below</em>)</ins>;
...    
    void swap(queue&amp; q) <ins>noxcept(noexcept(c.swap(q.c)))
      </ins>{ c.swap(q.c); }
  };
...
  template &lt;class T, class Container&gt;
    void swap(queue&lt;T, Container&gt;&amp; x, queue&lt;T, Container&gt;&amp; y)
      <ins>noexcept(noexcept(x.swap(y)))</ins>;
...
}
</pre>

<h3>23.5.1.2 queue constructors [queue.cons]</h3>

After p. 1
<pre>explicit queue(Container&amp;&amp; cont = Container())<ins> noexcept(<em>see below</em>)</ins>;</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_move_constructible&lt;Container&gt;::value</ins>
</pre>

After p. 2
<pre>queue(queue&amp;&amp; q)<ins> noexcept(</em>see below</em>)</ins>;</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_constructible&lt;Container, Container&amp;&amp;&gt;::value</ins>
</pre>

After p. 3
<pre>queue&amp; operator=(queue&amp;&amp; q)<ins> noexcept(<em>see below</em>)</ins>;</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>has_nothrow_move_assign&lt;Container&gt;::value</ins>
</pre>

<h3>23.5.1.3 queue constructors with allocators [queue.cons.alloc]</h3>

After p. 3
<pre>
template &lt;class Alloc&gt;
  queue(container_type&amp;&amp; cont, const Alloc&amp; a)<ins> noexcept(<em>see below</em>)</ins>;
</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_constructible&lt;Container, Container&amp;&amp;, const Alloc&amp;&gt;::value</ins>
</pre>

After p. 5
<pre>
template &lt;class Alloc&gt;
  queue(queue&amp;&amp; q, const Alloc&amp; a)<ins> noexcept(<em>see below</em>)</ins>;
</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_constructible&lt;Container, Container&amp;&amp;, const Alloc&amp;&gt;::value</ins>
</pre>

<h3>23.5.1.5 queue specialized algorithms [queue.special]</h3>

Before p. 1
<pre>
template &lt;class T, class Container&gt;
  void swap(queue&lt;T, Container&gt;&amp; x, queue&lt;T, Container&gt;&amp; y)<ins>noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.5.2 Class template priority_queue [priority.queue]</h3>

After p. 1
<pre>
namespace std {
  template &lt;class T, class Container = vector&lt;T&gt;,
    class Compare = less&lt;typename Container::value_type&gt; &gt;
  class priority_queue {
  public:
...
    explicit priority_queue(const Compare&amp; x = Compare(), Container&amp;&amp; = Container())<ins> noexcept(<em>see below</em>)</ins>;
...
    priority_queue(priority_queue&amp;&amp;)<ins> noexcept(<em>see below</em>)</ins>;
...
    template &lt;class Alloc&gt; priority_queue(const Compare&amp;,
                                          Container&amp;&amp;, const Alloc&amp;)<ins> noexcept(<em>see below</em>)</ins>;
...
    template &lt;class Alloc&gt; priority_queue(priority_queue&amp;&amp;, const Alloc&amp;)<ins> noexcept(<em>see below</em>)</ins>;
    priority_queue&amp; operator=(priority_queue&amp;&amp;)<ins> noexcept(<em>see below</em>)</ins>;
...
    void swap(priority_queue&amp;<ins> q</ins>)<ins> noexcept(
      noexcept(c.swap(q.c)) &amp;&amp; 
      noexcept(comp.swap(q.comp)))</ins>;
  };
  // no equality is provided
  template &lt;class T, class Container, class Compare&gt;
    void swap(priority_queue&lt;T, Container, Compare&gt;&amp; x, priority_queue&lt;T, Container, Compare&gt;&amp; y)<ins>
      noexcept(noexcept(x.swap(y)))</ins>;
...
}
</pre>

<h3>23.5.2.1 priority_queue constructors [priqueue.cons]</h3>

Before p. 1
<pre>
priority_queue(const Compare&amp; x,
	       const Container&amp; y);
explicit priority_queue(const Compare&amp; x = Compare(),
                        Container&amp;&amp; y = Container())<ins> noexcept(<em>see below</em>)</ins>;
</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> in the second constructor is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_copy_constructible&lt;Compare&gt;::value &amp;&amp;</ins>
  <ins>is_nothrow_move_constructible&lt;Container&gt;::value &amp;&amp;</ins>
  <ins>noexcept(make_heap(y.begin(), y.end(), x))</ins>
</pre>

After p. 4
<pre>
priority_queue(priority_queue&amp;&amp; q)<ins> noexcept(<em>see below</em>)<ins>;
</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_move_constructible&lt;Compare&gt;::value &amp;&amp;</ins>
  <ins>is_notrhow_move_constructible&lt;Container&gt;::value</ins>
</pre>

After p. 5
<pre>priority_queue&amp; operator=(priority_queue&amp;&amp; q)<ins> noexcept(<em>see below</em>)<ins>;</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_move_assignable&lt;Compare&gt;::value &amp;&amp;</ins>
  <ins>is_notrhow_move_assignable&lt;Container&gt;::value</ins>
</pre>

<h3>23.5.2.2 priority_queue constructors with allocators [priqueue.cons.alloc]</h3>

After p. 4
<pre>
template &lt;class Alloc&gt;
  priority_queue(const Compare&amp; compare, Container&amp;&amp; cont, const Alloc&amp; a);
</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_constructible&lt;Container, Container&amp;&amp;, const Alloc&amp;&gt;::value &amp;&amp;</ins>
  <ins>is_nothrow_copy_constructible&lt;Compare&gt;::value</ins>
</pre>

<h3>23.5.2.4 priority_queue specialized algorithms [priqueue.special]</h3>

Before p. 1
<pre>
template &lt;class T, class Container, Compare&gt;
  void swap(priority_queue&lt;T, Container, Compare&gt;&amp; x, priority_queue&lt;T, Container, Compare&gt;&amp; y)
    <ins>noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.5.3.1 stack definition [stack.defn]</h3>

<pre>
namespace std {
  template &lt;class T, class Container = deque&lt;T&gt; &gt;
  class stack {
  public:
...
    explicit stack(Container&amp;&amp; = Container());
    stack(stack&amp;&amp;s)<ins> noexcept(<em>see below</em>)</ins>;
...
    template &lt;class Alloc&gt; stack(Container&amp;&amp;, const Alloc&amp;)<ins> noexcept(<em>see below</em>)</ins>;
...
    template &lt;class Alloc&gt; stack(stack&amp;&amp;, const Alloc&amp;)<ins> noexcept(<em>see below</em>)</ins>;
    stack&amp; operator=(stack&amp;&amp; s)<ins> noexcept(<em>see below</em>)</ins>;
...
    void swap(stack&amp; s)<ins> noexcept(noexcept(c.swap(s.c)))</ins> { c.swap(s.c); }
  };
...
  template &lt;class T, class Container, class Alloc&gt;
    struct uses_allocator&lt;stack&lt;T, Container&gt;, Alloc&gt;
      : uses_allocator&lt;Container, Alloc&gt;::type { };
}
</pre>

<h3>23.5.3.2 stack constructors [stack.cons]</h3>

Before p. 1
<pre>stack(stack&amp;&amp; s)<ins> noexcept(<em>see below</em>)</ins>;</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_move_constructible&lt;Container&gt;::value</ins>
</pre>

After p. 1
<pre>stack&amp; operator=(stack&amp;&amp; s)<ins> noexcept(<em>see below</em>)</ins>;</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_move_constructible&lt;Container&gt;::value</ins>
</pre>

<h3>23.5.3.3 stack constructors with allocators [stack.cons.alloc]</h3>

After p. 3
<pre>
template &lt;class Alloc&gt;
  stack(container_type&amp;&amp; cont, const Alloc&amp; a)<ins> noexcept(<em>see below</em>)</ins>;
</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_constructible&lt;Container, Container&amp;&amp;, const Alloc&amp;&gt;::value</ins>
</pre>

After p. 5
<pre>
template &lt;class Alloc&gt;
  stack(stack&amp;&amp; s, const Alloc&amp; a)<ins> noexcept(<em>see below</em>)</ins>;
</pre>
<p><ins><em>Remarks</em>: The expression inside <tt>noexcept</tt> is equivalent to:</ins></p>
<pre>
  <ins>is_nothrow_constructible&lt;Container, Container&amp;&amp;, const Alloc&amp;&gt;::value</ins>
</pre>

<h3>23.5.3.5 stack specialized algorithms [stack.special]</h3>

Before p. 1
<pre>
template &lt;class T, class Container&gt;
  void swap(stack&lt;T, Container&gt;&amp; x, stack&lt;T, Container&gt;&amp; y)<ins>noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.6 Associative containers [associative]</h3>

After p. 1
<p><b>Header &lt;map&gt; synopsis</b></p>
<pre>
namespace std {
...
template &lt;class Key, class T, class Compare, class Allocator&gt;
  void swap(map&lt;Key,T,Compare,Allocator&gt;&amp; x,
            map&lt;Key,T,Compare,Allocator&gt;&amp; y)<ins> noexcept(<em>see below</em>)</ins>;
...
template &lt;class Key, class T, class Compare, class Allocator&gt;
  void swap(multimap&lt;Key,T,Compare,Allocator&gt;&amp; x,
	    multimap&lt;Key,T,Compare,Allocator&gt;&amp; y)<ins> noexcept(<em>see below</em>)</ins>;
}
</pre>
<p><b>Header &lt;set&gt; synopsis</b></p>
<pre>
namespace std {
...
template &lt;class Key, class Compare, class Allocator&gt;
  void swap(set&lt;Key,Compare,Allocator&gt;&amp; x,
            set&lt;Key,Compare,Allocator&gt;&amp; y)<ins> noexcept(<em>see below</em>)</ins>;
...
template &lt;class Key, class Compare, class Allocator&gt;
  void swap(multiset&lt;Key,Compare,Allocator&gt;&amp; x,
            multiset&lt;Key,Compare,Allocator&gt;&amp; y)<ins> noexcept(<em>see below</em>)</ins>;
}
</pre>

<h3>23.6.1 Class template map [map]</h3>

After p. 2
<pre>
namespace std {
  template &lt;class Key, class T, class Compare = less&lt;Key&gt;,
            class Allocator = allocator&lt;pair&lt;const Key, T&gt; &gt; &gt;
  class map {
  public:
...
    // 23.6.1.1 construct/copy/destroy:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // iterators:
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;

    reverse_iterator rbegin()<ins> noexcept</ins>;
    const_reverse_iterator rbegin() const<ins> noexcept</ins>;
    reverse_iterator rend()<ins> noexcept</ins>;
    const_reverse_iterator rend() const<ins> noexcept</ins>;

    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;
    const_reverse_iterator crbegin() const<ins> noexcept</ins>;
    const_reverse_iterator crend() const<ins> noexcept</ins>;

    // capacity:
    bool empty() const<ins> noexcept</ins>;
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;
...
// modifiers:
...
    void swap(map&lt;Key,T,Compare,Allocator&gt;&amp;<ins> m</ins>)<ins>
      noexcept(noexcept(swap(declval&lt;key_compare&amp;&gt;(), declval&lt;key_compare&amp;&gt;())))</ins>;
    void clear()<ins> noexcept</ins>;
...
  };
...
  // specialized algorithms:
  template &lt;class Key, class T, class Compare, class Allocator&gt;
    void swap(map&lt;Key,T,Compare,Allocator&gt;&amp; x,
	      map&lt;Key,T,Compare,Allocator&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;

</pre>

<h3>23.6.1.5 map specialized algorithms [map.special]</h3>

Before p. 1
<pre>
template &lt;class Key, class T, class Compare, class Allocator&gt;
  void swap(map&lt;Key,T,Compare,Allocator&gt;&amp; x,
            map&lt;Key,T,Compare,Allocator&gt;&amp; y)<ins>noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.6.2 Class template multimap [multimap]</h3>

After p. 2
<pre>
namespace std {
  template &lt;class Key, class T, class Compare = less&lt;Key&gt;,
            class Allocator = allocator&lt;pair&lt;const Key, T&gt; &gt; &gt;
  class multimap {
  public:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // iterators:
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;

    reverse_iterator rbegin()<ins> noexcept</ins>;
    const_reverse_iterator rbegin() const<ins> noexcept</ins>;
    reverse_iterator rend()<ins> noexcept</ins>;
    const_reverse_iterator rend() const<ins> noexcept</ins>;

    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;
    const_reverse_iterator crbegin() const<ins> noexcept</ins>;
    const_reverse_iterator crend() const<ins> noexcept</ins>;

    // capacity:
    bool empty() const<ins> noexcept</ins>;
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;
...
    // modifiers:
...
    void swap(multimap&lt;Key,T,Compare,Allocator&gt;&amp;)<ins>
      noexcept(noexcept(swap(declval&lt;key_compare&amp;&gt;(),declval&lt;key_compare&amp;&gt;())))</ins>;
    void clear()<ins> noexcept</ins>;
...
  };

...
  // specialized algorithms:
  template &lt;class Key, class T, class Compare, class Allocator&gt;
    void swap(multimap&lt;Key,T,Compare,Allocator&gt;&amp; x,
	      multimap&lt;Key,T,Compare,Allocator&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
}
</pre>

<h3>23.6.2.4 multimap specialized algorithms [multimap.special]</h3>

Before p. 1
<pre>
template &lt;class Key, class T, class Compare, class Allocator&gt;
  void swap(multimap&lt;Key,T,Compare,Allocator&gt;&amp; x,
            multimap&lt;Key,T,Compare,Allocator&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.6.3 Class template set [set]</h3>

After p. 2
<pre>
namespace std {
  template &lt;class Key, class Compare = less&lt;Key&gt;,
            class Allocator = allocator&lt;Key&gt; &gt;
  class set {
  public:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // iterators:
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;

    reverse_iterator rbegin()<ins> noexcept</ins>;
    const_reverse_iterator rbegin() const<ins> noexcept</ins>;
    reverse_iterator rend()<ins> noexcept</ins>;
    const_reverse_iterator rend() const<ins> noexcept</ins>;

    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;
    const_reverse_iterator crbegin() const<ins> noexcept</ins>;
    const_reverse_iterator crend() const<ins> noexcept</ins>;

    // capacity:
    bool empty() const<ins> noexcept</ins>;
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;

    // modifiers:
...
    void swap(set&lt;Key,Compare,Allocator&gt;&amp;)<ins>
      noexcept(noexcept(swap(declval&lt;key_compare&amp;&gt;(), declval&lt;key_compare&amp;&gt;())))</ins>;
    void clear()<ins> noexcept</ins>;
...
  };
...
  // specialized algorithms:
  template &lt;class Key, class Compare, class Allocator&gt;
    void swap(set&lt;Key,Compare,Allocator&gt;&amp; x,
	      set&lt;Key,Compare,Allocator&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
}
</pre>

<h3>23.6.3.2 set specialized algorithms [set.special]</h3>

Before p. 1
<pre>
template &lt;class Key, class Compare, class Allocator&gt;
  void swap(set&lt;Key,Compare,Allocator&gt;&amp; x,
	    set&lt;Key,Compare,Allocator&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.6.4 Class template multiset [multiset]</h3>

After p. 2
<pre>
namespace std {
  template &lt;class Key, class Compare = less&lt;Key&gt;,
            class Allocator = allocator&lt;Key&gt; &gt;
  class multiset {
  public:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // iterators:
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;

    reverse_iterator rbegin()<ins> noexcept</ins>;
    const_reverse_iterator rbegin() const<ins> noexcept</ins>;
    reverse_iterator rend()<ins> noexcept</ins>;
    const_reverse_iterator rend() const<ins> noexcept</ins>;

    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;
    const_reverse_iterator crbegin() const<ins> noexcept</ins>;
    const_reverse_iterator crend() const<ins> noexcept</ins>;

    // capacity:
    bool empty() const<ins> noexcept</ins>;
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;

    // modifiers:
...
    void swap(multiset&lt;Key,Compare,Allocator&gt;&amp;)<ins>
      noexcept(noexcept(swap(declval&lt;key_compare&amp;&gt;(), declval&lt;key_compare&amp;&gt;())))</ins>;
    void clear()<ins> noexcept</ins>;
...
  };
...
  // specialized algorithms:
  template &lt;class Key, class Compare, class Allocator&gt;
    void swap(multiset&lt;Key,Compare,Allocator&gt;&amp; x,
	      multiset&lt;Key,Compare,Allocator&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
}
</pre>

<h3>23.6.4.2 multiset specialized algorithms [multiset.special]</h3>

Before p. 1
<pre>
template &lt;class Key, class Compare, class Allocator&gt;
  void swap(multiset&lt;Key,Compare,Allocator&gt;&amp; x,
	    multiset&lt;Key,Compare,Allocator&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.7 Unordered associative containers [unord]</h3>

After p. 1
<p><b>Header &lt;unordered_map&gt; synopsis</b></p>
<pre>
namespace std {
...
  template &lt;class Key, class T, class Hash, class Pred, class Alloc&gt;
    void swap(unordered_map&lt;Key, T, Hash, Pred, Alloc&gt;&amp; x,
	      unordered_map&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y)<ins>
    noexcept(noexcept(x.swap(y)))</ins>;

  template &lt;class Key, class T, class Hash, class Pred, class Alloc&gt;
    void swap(unordered_multimap&lt;Key, T, Hash, Pred, Alloc&gt;&amp; x,
	      unordered_multimap&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y)<ins>
    noexcept(noexcept(x.swap(y)))</ins>;

} // namespace std
</pre>
<p><b>Header &lt;unordered_set&gt; synopsis</b></p>
<pre>
namespace std {
...
  template &lt;class Key, class Hash, class Pred, class Alloc&gt;
    void swap(unordered_set&lt;Key, Hash, Pred, Alloc&gt;&amp; x,
	      unordered_set&lt;Key, Hash, Pred, Alloc&gt;&amp; y)<ins>
    noexcept(noexcept(x.swap(y)))</ins>;

  template &lt;class Key, class Hash, class Pred, class Alloc&gt;
    void swap(unordered_multiset&lt;Key, Hash, Pred, Alloc&gt;&amp; x,
	      unordered_multiset&lt;Key, Hash, Pred, Alloc&gt;&amp; y)<ins>
    noexcept(noexcept(x.swap(y)))</ins>;
...
} // namespace std
</pre>

<h3>23.7.1 Class template unordered_map [unord.map]</h3>

After p. 3
<pre>
namespace std {
template &lt;class Key,
          class T,
          class Hash = hash&lt;Key&gt;,
          class Pred = std::equal_to&lt;Key&gt;,
          class Alloc = std::allocator&lt;std::pair&lt;const Key, T&gt; &gt; &gt;
  class unordered_map
  {
  public:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // size and capacity
    bool empty() const<ins> noexcept</ins>;
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;

    // iterators
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;
    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;

    // modifiers
...
    void clear()<ins> noexcept</ins>;

    void swap(unordered_map&amp;)<ins> noexcept(
      noexcept(swap(declval&lt;hasher&amp;&gt;(),declval&lt;hasher&amp;&gt;())) &amp;&amp;
      noexcept(swap(declval&lt;key_equal&amp;&gt;(), declval&lt;key_equal&amp;&gt;())))</ins>;
...
    // bucket interface
    size_type bucket_count() const<ins> noexcept</ins>;
    size_type max_bucket_count() const<ins> noexcept</ins>;
    size_type bucket_size(size_type n)<ins> noexcept</ins>;
    size_type bucket(const key_type&amp; k) const<ins> noexcept</ins>;
    local_iterator begin(size_type n)<ins> noexcept</ins>;
    const_local_iterator begin(size_type n) const<ins> noexcept</ins>;
    local_iterator end(size_type n)<ins> noexcept</ins>;
    const_local_iterator end(size_type n) const<ins> noexcept</ins>;
    const_local_iterator cbegin(size_type n) const<ins> noexcept</ins>;
    const_local_iterator cend(size_type n) const<ins> noexcept</ins>;

    // hash policy
    float load_factor() const<ins> noexcept</ins>;
    float max_load_factor() const<ins> noexcept</ins>;
    void max_load_factor(float z)<ins> noexcept</ins>;
...
  };

template &lt;class Key, class T, class Hash, class Pred, class Alloc&gt;
  void swap(unordered_map&lt;Key, T, Hash, Pred, Alloc&gt;&amp; x,
	    unordered_map&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
}
</pre>

<h3>23.7.1.4 unordered_map swap [unord.map.swap]</h3>

Before p. 1
<pre>
template &lt;class Key, class T, class Hash, class Pred, class Alloc&gt;
  void swap(unordered_map&lt;Key, T, Hash, Pred, Alloc&gt;&amp; x,
	    unordered_map&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.7.2 Class template unordered_multimap [unord.multimap]</h3>

After p. 3
<pre>
namespace std {
  template &lt;class Key,
            class T,
            class Hash = hash&lt;Key&gt;,
            class Pred = std::equal_to&lt;Key&gt;,
            class Alloc = std::allocator&lt;std::pair&lt;const Key, T&gt; &gt; &gt;
  class unordered_multimap
  {
  public:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // size and capacity
    bool empty() const<ins> noexcept</ins>;
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;

    // iterators
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;
    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;

    // modifiers
...
    void clear()<ins> noexcept</ins>;

    void swap(unordered_multimap&amp;)<ins>noexcept(
      noexcept(swap(declval&lt;hasher&amp;&gt;(),declval&lt;hasher&amp;&gt;())) &amp;&amp;
      noexcept(swap(declval&lt;key_equal&amp;&gt;(), declval&lt;key_equal&amp;&gt;())))</ins>;
...
    // bucket interface
    size_type bucket_count() const<ins> noexcept</ins>;
    size_type max_bucket_count() const<ins> noexcept</ins>;
    size_type bucket_size(size_type n)<ins> noexcept</ins>;
    size_type bucket(const key_type&amp; k) const<ins> noexcept</ins>;
    local_iterator begin(size_type n)<ins> noexcept</ins>;
    const_local_iterator begin(size_type n) const<ins> noexcept</ins>;
    local_iterator end(size_type n)<ins> noexcept</ins>;
    const_local_iterator end(size_type n) const<ins> noexcept</ins>;
    const_local_iterator cbegin(size_type n) const<ins> noexcept</ins>;
    const_local_iterator cend(size_type n) const<ins> noexcept</ins>;

    // hash policy
    float load_factor() const<ins> noexcept</ins>;
    float max_load_factor() const<ins> noexcept</ins>;
    void max_load_factor(float z)<ins> noexcept</ins>;
...
  };

  template &lt;class Key, class T, class Hash, class Pred, class Alloc&gt;
    void swap(unordered_multimap&lt;Key, T, Hash, Pred, Alloc&gt;&amp; x,
              unordered_multimap&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
}
</pre>

<h3>23.7.2.3 unordered_multimap swap [unord.multimap.swap]</h3>

Before p. 1
<pre>
template &lt;class Key, class T, class Hash, class Pred, class Alloc&gt;
  void swap(unordered_multimap&lt;Key, T, Hash, Pred, Alloc&gt;&amp; x,
            unordered_multimap&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.7.3 Class template unordered_set [unord.set]</h3>

After p. 3
<pre>
namespace std {
  template &lt;class Key,
            class Hash = hash&lt;Key&gt;,
            class Pred = std::equal_to&lt;Key&gt;,
            class Alloc = std::allocator&lt;Key&gt; &gt;
   class unordered_set
  {
  public:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // size and capacity
    bool empty() const<ins> noexcept</ins>;
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;

    // iterators
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;
    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;

    // modifiers
...
    void clear()<ins> noexcept</ins>;

    void swap(unordered_set&amp;)<ins>noexcept(
      noexcept(swap(declval&lt;hasher&amp;&gt;(),declval&lt;hasher&amp;&gt;())) &amp;&amp;
      noexcept(swap(declval&lt;key_equal&amp;&gt;(), declval&lt;key_equal&amp;&gt;())))</ins>;
...
    // bucket interface
    size_type bucket_count() const<ins> noexcept</ins>;
    size_type max_bucket_count() const<ins> noexcept</ins>;
    size_type bucket_size(size_type n)<ins> noexcept</ins>;
    size_type bucket(const key_type&amp; k) const<ins> noexcept</ins>;
    local_iterator begin(size_type n)<ins> noexcept</ins>;
    const_local_iterator begin(size_type n) const<ins> noexcept</ins>;
    local_iterator end(size_type n)<ins> noexcept</ins>;
    const_local_iterator end(size_type n) const<ins> noexcept</ins>;
    const_local_iterator cbegin(size_type n) const<ins> noexcept</ins>;
    const_local_iterator cend(size_type n) const<ins> noexcept</ins>;

    // hash policy
    float load_factor() const<ins> noexcept</ins>;
    float max_load_factor() const<ins> noexcept</ins>;
    void max_load_factor(float z)<ins> noexcept</ins>;
...
  };

  template &lt;class Key, class T, class Hash, class Pred, class Alloc&gt;
    void swap(unordered_set&lt;Key, T, Hash, Pred, Alloc&gt;&amp; x,
              unordered_set&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
}
</pre>

<h3>23.7.3.2 unordered_set swap [unord.set.swap]</h3>

Before p. 1
<pre>
template &lt;class Key, class Hash, class Pred, class Alloc&gt;
  void swap(unordered_set&lt;Key, Hash, Pred, Alloc&gt;&amp; x,
	    unordered_set&lt;Key, Hash, Pred, Alloc&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
</pre>

<h3>23.7.4 Class template unordered_multiset [unord.multiset]</h3>

After p. 3
<pre>
namespace std {
  template <class Key,
            class Hash = hash<Key>,
            class Pred = std::equal_to<Key>,
            class Alloc = std::allocator<Key> >
  class unordered_multiset
  {
  public:
...
    allocator_type get_allocator() const<ins> noexcept</ins>;

    // size and capacity
    bool empty() const<ins> noexcept</ins>;
    size_type size() const<ins> noexcept</ins>;
    size_type max_size() const<ins> noexcept</ins>;

    // iterators
    iterator begin()<ins> noexcept</ins>;
    const_iterator begin() const<ins> noexcept</ins>;
    iterator end()<ins> noexcept</ins>;
    const_iterator end() const<ins> noexcept</ins>;
    const_iterator cbegin() const<ins> noexcept</ins>;
    const_iterator cend() const<ins> noexcept</ins>;

    // modifiers
...
    void clear()<ins> noexcept</ins>;

    void swap(unordered_multiset&amp;)<ins>noexcept(
      noexcept(swap(declval&lt;hasher&amp;&gt;(),declval&lt;hasher&amp;&gt;())) &amp;&amp;
      noexcept(swap(declval&lt;key_equal&amp;&gt;(), declval&lt;key_equal&amp;&gt;())))</ins>;
...
    // bucket interface
    size_type bucket_count() const<ins> noexcept</ins>;
    size_type max_bucket_count() const<ins> noexcept</ins>;
    size_type bucket_size(size_type n)<ins> noexcept</ins>;
    size_type bucket(const key_type&amp; k) const<ins> noexcept</ins>;
    local_iterator begin(size_type n)<ins> noexcept</ins>;
    const_local_iterator begin(size_type n) const<ins> noexcept</ins>;
    local_iterator end(size_type n)<ins> noexcept</ins>;
    const_local_iterator end(size_type n) const<ins> noexcept</ins>;
    const_local_iterator cbegin(size_type n) const<ins> noexcept</ins>;
    const_local_iterator cend(size_type n) const<ins> noexcept</ins>;

    // hash policy
    float load_factor() const<ins> noexcept</ins>;
    float max_load_factor() const<ins> noexcept</ins>;
    void max_load_factor(float z)<ins> noexcept</ins>;
...
  };

  template &lt;class Key, class T, class Hash, class Pred, class Alloc&gt;
    void swap(unordered_multiset&lt;Key, T, Hash, Pred, Alloc&gt;&amp; x,
              unordered_multiset&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
}
</pre>

<h3>23.7.4.2 unordered_multiset swap [unord.multiset.swap]</h3>

Before p. 1
<pre>
template &lt;class Key, class T, class Hash, class Pred, class Alloc&gt;
  void swap(unordered_multiset&lt;Key, T, Hash, Pred, Alloc&gt;&amp; x,
            unordered_multiset&lt;Key, T, Hash, Pred, Alloc&gt;&amp; y)<ins> noexcept(noexcept(x.swap(y)))</ins>;
</pre>

</body>
</html>
