﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>N3148 - throw() becomes noexcept (Version 2)</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: N3148=10-0138<br/>
	    Date: 2010-10-14<br/>
	    Author: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>N3148 - <tt>throw()</tt> becomes <tt>noexcept</tt> (Version 2)</h1>

<p>
During the Rapperswil meeting the Library Working Group decided to change the empty dynamic exception specifications 
in the librrary to the <tt>noexcept</tt> specification in the standard library. There was unanimous consent about 
this change.
</p>

<p>
This paper presents proposed wording for this set of changes.
</p>

<p>
The paper addresses National Body comments CH 16 and GB 60.
</p>

<h2>Identified changes</h2>

    All changes in this paper are against N3126.

    This paper proposes the following changes:
    <ul>
	    <li>Delete every empty dynamic exception specification in the library.</li>
	    <li>Add <tt>noexcept</tt> specifications to the places where formerly there was an empty exception specification.</li>
	    <li>Delete every empty dynamic exception specification from destructors.</li>
    </ul>

    The exception specifications for class <tt>auto_ptr</tt> have not been updated as it is a deprecated class. The same is apllied to <tt>set_unexpected</tt>.

    <h2>Revision history</h2>

    Since N3114 the following changes have been made:
    <ul>
      <li>Minor editorial adaptations to the latest working draft (N3126).</li>
      <li>Removed reference to <tt>set_unexpected</tt>, which is now deprecated.</li>
      <li>Updated restrictions on exception handling for C and C++ libraries.</li>
      <li>Corrected adding <tt>noexcept</tt> to defaulted members, which is not allowed by language.</li>
      <li>Revised <tt>throw()</tt> specifications in chapter 3.</li>
    </ul>

<h2>Acknowledgments</h2>

<p>
I would like to thank Alisdair Meredith for guiding me in the writing of the first version of this paper and 
providing me with hints to improve it.
</p>

<p>
Daniel Kr&uuml;gler and David Svoboda provided very useful feedback for the final version of this paper.
</p>

<h1>Wording</h1>

<h2>3.7.4 Dynamic storage duration</h2>

After p. 2
<pre>
...
void operator delete(void*) <del>throw()</del><ins>noexcept</ins>;
void operator delete[](void*) <del>throw()</del><ins>noexcept</ins>;
</pre>

<h2>17.6.4.11 Restrictions on exception handling</h2>

<p>1 Any of the functions defined in the C++ standard library can report a failure by throwing an exception of
a type described in its <b>Throws:</b> paragraph<del> or its <em>exception-specification</em> (15.4)</del>. An implementation may
strengthen the <em>exception-specification</em> for a non-virtual function by <del>removing listed exceptions</del>
<ins>adding a non-throwing <em>noexcept-specification</em></ins>.<sup>195</sup></p>

Delete footnote 195:

<p><del>195) That is, an implementation of the function will have an explicit <em>exception-specification</em> that lists 
fewer exceptions than those specified in this International Standard. It may not, however, change the types of exceptions listed 
in the <em>exception-specification</em> from those specified, nor add others</del>.</p>

Modify footnote 196:

<p>196) That is, the C library functions can all be treated as if they <del>have a throw() exception-specification</del><ins>are <tt>noexcept</tt></ins>. This allows implementations
to make performance optimizations based on the absence of exceptions at runtime.</p>

<h2>18.3.1.1 Class template <tt>numeric_limits</tt></h2>
<pre><tt>
namespace std {
  template&lt;class T&gt; class numeric_limits {
  public:
    static constexpr bool is_specialized = false;
    static constexpr T min() <del>throw()</del><ins>noexcept</ins> { return T(); }
    static constexpr T max() <del>throw()</del><ins>noexcept</ins> { return T(); }
    static constexpr T lowest() <del>throw()</del><ins>noexcept</ins> { return T(); }
    static constexpr int digits = 0;
    static constexpr int digits10 = 0;
    static constexpr int max_digits10 = 0;
    static constexpr bool is_signed = false;
    static constexpr bool is_integer = false;
    static constexpr bool is_exact = false;
    static constexpr int radix = 0;
    static constexpr T epsilon() <del>throw()</del><ins>noexcept</ins> { return T(); }
    static constexpr T round_error() <del>throw()</del><ins>noexcept</ins> { return T(); }
    static constexpr int min_exponent = 0;
    static constexpr int min_exponent10 = 0;
    static constexpr int max_exponent = 0;
    static constexpr int max_exponent10 = 0;
    static constexpr bool has_infinity = false;
    static constexpr bool has_quiet_NaN = false;
    static constexpr bool has_signaling_NaN = false;
    static constexpr float_denorm_style has_denorm = denorm_absent;
    static constexpr bool has_denorm_loss = false;
    static constexpr T infinity() <del>throw()</del><ins>noexcept</ins> { return T(); }
    static constexpr T quiet_NaN() <del>throw()</del><ins>noexcept</ins> { return T(); }
    static constexpr T signaling_NaN() <del>throw()</del><ins>noexcept</ins> { return T(); }
    static constexpr T denorm_min() <del>throw()</del><ins>noexcept</ins> { return T(); }
    static constexpr bool is_iec559 = false;
    static constexpr bool is_bounded = false;
    static constexpr bool is_modulo = false;
    static constexpr bool traps = false;
    static constexpr bool tinyness_before = false;
    static constexpr float_round_style round_style = round_toward_zero;
  };
  template&lt;class T&gt; class numeric_limits&lt;const T&gt;;
  template&lt;class T&gt; class numeric_limits&lt;volatile T&gt;;
  template&lt;class T&gt; class numeric_limits&lt;const volatile T&gt;;
}
</tt></pre>

<h2>18.3.1.2 <tt>numeric_limits</tt> members</h2>

<p>Before p.1:</p>
<pre><tt>static constexpr T min() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.3:</p>
<pre><tt>static constexpr T max() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.5:</p>
<pre><tt>static constexpr T lowest() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.23:</p>
<pre><tt>static constexpr T epsilon() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.25:</p>
<pre><tt>static constexpr T round_error() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.46:</p>
<pre><tt>static constexpr T infinity() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.48:</p>
<pre><tt>static constexpr T quiet_NaN() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.50:</p>
<pre><tt>static constexpr T signaling_NaN() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.52:</p>
<pre><tt>static constexpr T denorm_min() <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.3.1.5 <tt>numeric_limits</tt> specializations</h2>

<p>2 [<em>Example:</em></p>
<pre><tt>
namespace std {
  template&lt;&gt; class numeric_limits&lt;float&gt; {
  public:
    static constexpr bool is_specialized = true;
    inline static constexpr float min() <del>throw()</del><ins>noexcept</ins> { return 1.17549435E-38F; }
    inline static constexpr float max() <del>throw()</del><ins>noexcept</ins> { return 3.40282347E+38F; }
    inline static constexpr float lowest() <del>throw()</del><ins>noexcept</ins> { return -3.40282347E+38F; }
    static constexpr int digits = 24;
    static constexpr int digits10 = 6;
    static constexpr int max_digits10 = 9;
    static constexpr bool is_signed = true;
    static constexpr bool is_integer = false;
    static constexpr bool is_exact = false;
    static constexpr int radix = 2;
    inline static constexpr float epsilon() <del>throw()</del><ins>noexcept</ins> { return 1.19209290E-07F; }
    inline static constexpr float round_error() <del>throw()</del><ins>noexcept</ins> { return 0.5F; }
    static constexpr int min_exponent = -125;
    static constexpr int min_exponent10 = - 37;
    static constexpr int max_exponent = +128;
    static constexpr int max_exponent10 = + 38;
    static constexpr bool has_infinity = true;
    static constexpr bool has_quiet_NaN = true;
    static constexpr bool has_signaling_NaN = true;
    static constexpr float_denorm_style has_denorm = denorm_absent;
    static constexpr bool has_denorm_loss = false;
    inline static constexpr float infinity() <del>throw()</del><ins>noexcept</ins> { return ...; }
    inline static constexpr float quiet_NaN() <del>throw()</del><ins>noexcept</ins> { return ...; }
    inline static constexpr float signaling_NaN() <del>throw()</del><ins>noexcept</ins> { return ...; }
    inline static constexpr float denorm_min() <del>throw()</del><ins>noexcept</ins> { return min(); }
    static constexpr bool is_iec559 = true;
    static constexpr bool is_bounded = true;
    static constexpr bool is_modulo = false;
    static constexpr bool traps = true;
    static constexpr bool tinyness_before = true;
    static constexpr float_round_style round_style = round_to_nearest;
  };
}
</tt></pre>
<p>-- <em>end example</em>]</p>

<p>3 The specialization for <tt>bool</tt> shall be provided as follows:</p>
<pre><tt>
namespace std {
  template&lt;&gt; class numeric_limits&lt;bool&gt; { 
  public:
    static constexpr bool is_specialized = true;
    static constexpr bool min() <del>throw()</del><ins>noexcept</ins> { return false; }
    static constexpr bool max() <del>throw()</del><ins>noexcept</ins> { return true; }
    static constexpr bool lowest() <del>throw()</del><ins>noexcept</ins> { return false; }
    static constexpr int digits = 1;
    static constexpr int digits10 = 0;
    static constexpr int max_digits10 = 0;
    static constexpr bool is_signed = false;
    static constexpr bool is_integer = true;
    static constexpr bool is_exact = true;
    static constexpr int radix = 2;
    static constexpr bool epsilon() <del>throw()</del><ins>noexcept</ins> { return 0; }
    static constexpr bool round_error() <del>throw()</del><ins>noexcept</ins> { return 0; }
    static constexpr int min_exponent = 0;
    static constexpr int min_exponent10 = 0;
    static constexpr int max_exponent = 0;
    static constexpr int max_exponent10 = 0;
    static constexpr bool has_infinity = false;
    static constexpr bool has_quiet_NaN = false;
    static constexpr bool has_signaling_NaN = false;
    static constexpr float_denorm_style has_denorm = denorm_absent;
    static constexpr bool has_denorm_loss = false;
    static constexpr bool infinity() <del>throw()</del><ins>noexcept</ins> { return 0; }
    static constexpr bool quiet_NaN() <del>throw()</del><ins>noexcept</ins> { return 0; }
    static constexpr bool signaling_NaN() <del>throw()</del><ins>noexcept</ins> { return 0; }
    static constexpr bool denorm_min() <del>throw()</del><ins>noexcept</ins> { return 0; }
    static constexpr bool is_iec559 = false;
    static constexpr bool is_bounded = true;
    static constexpr bool is_modulo = false;
    static constexpr bool traps = false;
    static constexpr bool tinyness_before = false;
    static constexpr float_round_style round_style = round_toward_zero;
  };
}
</tt></pre>

<h2>18.6 Dynamic memory management</h2>

<p>1 The header <tt>&lt;new&gt;</tt> defines several functions that manage the allocation of dynamic storage in a program. It
also defines components for reporting storage management errors.</p>

<h4>Header <tt>&lt;new&gt;</tt> synopsis</h4>
<pre><tt>
namespace std {
  class bad_alloc;
  class bad_array_new_length;
  struct nothrow_t {};
  extern const nothrow_t nothrow;
  typedef void (*new_handler)();
  new_handler set_new_handler(new_handler new_p) <del>throw()</del><ins>noexcept</ins>;
}

void* operator new(std::size_t size) throw(std::bad_alloc);
void* operator new(std::size_t size, const std::nothrow_t&) <del>throw()</del><ins>noexcept</ins>;
void operator delete(void* ptr) <del>throw()</del><ins>noexcept</ins>;
void operator delete(void* ptr, const std::nothrow_t&) <del>throw()</del><ins>noexcept</ins>;
void* operator new[](std::size_t size) throw(std::bad_alloc);
void* operator new[](std::size_t size, const std::nothrow_t&) <del>throw()</del><ins>noexcept</ins>;
void operator delete[](void* ptr) <del>throw()</del><ins>noexcept</ins>;
void operator delete[](void* ptr, const std::nothrow_t&) <del>throw()</del><ins>noexcept</ins>;
void* operator new (std::size_t size, void* ptr) <del>throw()</del><ins>noexcept</ins>;
void* operator new[](std::size_t size, void* ptr) <del>throw()</del><ins>noexcept</ins>;
void operator delete (void* ptr, void*) <del>throw()</del><ins>noexcept</ins>;
void operator delete[](void* ptr, void*) <del>throw()</del><ins>noexcept</ins>;
</tt></pre>

<h2>18.6.1.1 Single-object forms</h2>
<p>After p.4</p>
<pre><tt>void* operator new(std::size_t size, const std::nothrow_t&) <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.9</p>
<pre><tt>void operator delete(void* ptr) <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.15</p>
<pre><tt>void operator delete(void* ptr, const std::nothrow_t&) <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.6.1.2 Array forms</h2>
<p>After p.4</p>
<pre><tt>void* operator new[](std::size_t size, const std::nothrow_t&) <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.8</p>
<pre><tt>void operator delete[](void* ptr) <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.13</p<
<pre><tt>void operator delete[](void* ptr, const std::nothrow_t&) <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.6.1.3 Placement forms</h2>
<p>After p.1</p>
<pre><tt>void* operator new(std::size_t size, void* ptr) <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.4</p>
<pre><tt>void* operator new[](std::size_t size, void* ptr) <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.6</p>
<pre><tt>void operator delete(void* ptr, void*) <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.9</p>
<pre><tt>void operator delete[](void* ptr, void*) <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.6.2.1 Class <tt>bad_alloc</tt></h2>
<pre><tt>
namespace std {
  class bad_alloc : public exception {
  public:
    bad_alloc() <del>throw()</del><ins>noexcept</ins>;
    bad_alloc(const bad_alloc&) <del>throw()</del><ins>noexcept</ins>;
    bad_alloc& operator=(const bad_alloc&) <del>throw()</del><ins>noexcept</ins>;
    virtual const char* what() const <del>throw()</del><ins>noexcept</ins>;
  };
}
</tt></pre>

<p>After p.1</p>
<pre><tt>bad_alloc() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.3</p>
<pre><tt>
bad_alloc(const bad_alloc&) <del>throw()</del><ins>noexcept</ins>;
bad_alloc& operator=(const bad_alloc&) <del>throw()</del><ins>noexcept</ins>;
</tt></pre>
<p>After p.4</p>
<pre><tt>virtual const char* what() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.6.2.2 Class <tt>bad_array_new_length</tt></h2>
<pre><tt>
namespace std {
  class bad_array_new_length : public bad_alloc {
  public:
    bad_array_new_length() <del>throw()</del><ins>noexcept</ins>;
  };
}
</tt></pre>
<p>After p.1</p>
<pre><tt>bad_array_new_length() <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.6.2.4 <tt>set_new_handler</tt></h2>
<p>Before p.1</p>
<pre><tt>new_handler set_new_handler(new_handler new_p) <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.7.1 Class <tt>type_info</tt></h2>
<pre><tt>
namespace std {
  class type_info {
  public:
    virtual ~type_info();
    bool operator==(const type_info& rhs) const;
    bool operator!=(const type_info& rhs) const;
    bool before(const type_info& rhs) const;
    size_t hash_code() const <del>throw()</del><ins>noexcept</ins>;
    const char* name() const;
    type_info(const type_info& rhs) = delete; <em>/ cannot be copied</em>
    type_info& operator=(const type_info& rhs) = delete; <em>// cannot be copied</em>
  };
}
</tt></pre>
<p>After p.6</p>
<pre><tt>size_t hash_code() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.7.2 Class <tt>bad_cast</tt></h2>
<pre><tt>
namespace std {
  class bad_cast : public exception {
  public:
    bad_cast() <del>throw()</del><ins>noexcept</ins>;
    bad_cast(const bad_cast&) <del>throw()</del><ins>noexcept</ins>;
    bad_cast& operator=(const bad_cast&) <del>throw()</del><ins>noexcept</ins>;
    virtual const char* what() const <del>throw()</del><ins>noexcept</ins>;
  };
}
</tt></pre>

<p>After p.1</p>
<pre><tt>bad_cast() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.3</p>
<pre><tt>
bad_cast(const bad_cast&) <del>throw()</del><ins>noexcept</ins>;
bad_cast& operator=(const bad_cast&) <del>throw()</del><ins>noexcept</ins>;
</tt></pre>
<p>After p.4</p>
<pre><tt>virtual const char* what() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.7.3 Class <tt>bad_typeid</tt></h2>
<pre><tt>
namespace std {
  class bad_typeid : public exception {
  public:
    bad_typeid() <del>throw()</del><ins>noexcept</ins>;
    bad_typeid(const bad_typeid&) <del>throw()</del><ins>noexcept</ins>;
    bad_typeid& operator=(const bad_typeid&) <del>throw()</del><ins>noexcept</ins>;
    virtual const char* what() const <del>throw()</del><ins>noexcept</ins>;
  };
}
</tt></pre>

<p>After p.1</p>
<pre><tt>bad_typeid() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.3</p>
<pre><tt>
bad_typeid(const bad_typeid&) <del>throw()</del><ins>noexcept</ins>;
bad_typeid& operator=(const bad_typeid&) <del>throw()</del><ins>noexcept</ins>;
</tt></pre>
<p>After p.4</p>
<pre><tt>virtual const char* what() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.8 Exception handling</h2>
<p>1 The header <exception> defines several types and functions related to the handling of exceptions in a C++
program.</p>
<h4>Header <tt>&lt;exception&gt;</tt> synopsis</h4>
<pre><tt>
namespace std {
  class exception;
  class bad_exception;
  class nested_exception;

  typedef void (*unexpected_handler)();
  unexpected_handler set_unexpected(unexpected_handler f) <del>throw()</del><ins>noexcept</ins>;
  [[noreturn]] void unexpected();

  typedef void (*terminate_handler)();
  terminate_handler set_terminate(terminate_handler f) <del>throw()</del><ins>noexcept</ins>;
  [[noreturn]] void terminate();

  bool uncaught_exception() <del>throw()</del><ins>noexcept</ins>;

  typedef <em>unspecified</em> exception_ptr;

  exception_ptr current_exception();
  [[noreturn]] void rethrow_exception(exception_ptr p);
  template&lt;class E&gt; exception_ptr make_exception_ptr(E e);

  [[noreturn]] template &lt;class T&gt; void throw_with_nested(T&& t);
  template &lt;class E&gt; void rethrow_if_nested(const E& e);
}
</tt></pre>

<h2>18.8.1 Class <tt>exception</tt></h2>
<pre><tt>
namespace std {
  class exception {
  public:
    exception() <del>throw()</del><ins>noexcept</ins>;
    exception(const exception&) <del>throw()</del><ins>noexcept</ins>;
    exception& operator=(const exception&) <del>throw()</del><ins>noexcept</ins>;
    virtual ~exception() <del>throw()</del><ins>noexcept</ins>;
    virtual const char* what() const <del>throw()</del><ins>noexcept</ins>;
  };
}
</tt></pre>

<p>After p.2</p>
<pre><tt>exception() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.4</p>
<pre><tt>
exception(const exception& rhs) <del>throw()</del><ins>noexcept</ins>;
exception& operator=(const exception& rhs) <del>throw()</del><ins>noexcept</ins>;
</tt></pre>
<p>After p.6</p>
<pre><tt>virtual ~exception() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.8</p>
<pre><tt>virtual const char* what() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.8.2.1 Class <tt>bad_exception</tt></h2>
<pre><tt>
namespace std {
  class bad_exception : public exception {
  public:
    bad_exception() <del>throw()</del><ins>noexcept</ins>;
    bad_exception(const bad_exception&) <del>throw()</del><ins>noexcept</ins>;
    bad_exception& operator=(const bad_exception&) <del>throw()</del><ins>noexcept</ins>;
    virtual const char* what() const <del>throw()</del><ins>noexcept</ins>;
  };
}
</tt></pre>

<p>After p.1</p>
<pre><tt>bad_exception() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.3</p>
<pre><tt>
bad_exception(const bad_exception&) <del>throw()</del><ins>noexcept</ins>;
bad_exception& operator=(const bad_exception&) <del>throw()</del><ins>noexcept</ins>;
</tt></pre>
<p>After p.4</p>
<pre><tt>virtual const char* what() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.8.4.2 <tt>set_terminate</tt></h2>
<p>Before p.1</p>
<pre><tt>terminate_handler set_terminate(terminate_handler f) <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.8.5 <tt>uncaught_exception</tt></h2>
<p>Before p.1</p>
<pre><tt>bool uncaught_exception() <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>18.8.7 <tt>nested_exception</tt></h2>
<pre><tt>
namespace std {
  class nested_exception {
  public:
    nested_exception() <del>throw()</del><ins>noexcept</ins>;
    nested_exception(const nested_exception&) <del>throw()</del> = default;
    nested_exception& operator=(const nested_exception&) <del>throw()</del> = default;
    virtual ~nested_exception() = default;
  
    <em>// access functions</em>
    [[noreturn]] void rethrow_nested() const;
    exception_ptr nested_ptr() const;
  };

  [[noreturn]] template &lt;class T&gt; void throw_with_nested(T&& t);
  template &lt;class E&gt; void rethrow_if_nested(const E& e);
}
</tt></pre>
<p>After p.2</p>
<pre><tt>nested_exception() <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>19.5.6.1 Class <tt>system_error</tt> overview</h2>
<p>After p.2</p>
<pre><tt>
namespace std {
  class system_error : public runtime_error {
  public:
    system_error(error_code ec, const string& what_arg);
    system_error(error_code ec, const char* what_arg);
    system_error(error_code ec);
    system_error(int ev, const error_category& ecat, const string& what_arg);
    system_error(int ev, const error_category& ecat, const char* what_arg);
    system_error(int ev, const error_category& ecat);
    const error_code& code() const <del>throw()</del><ins>noexcept</ins>;
    const char* what() const <del>throw()</del><ins>noexcept</ins>;
  };
} <em>// namespace std</em>
</tt></pre>

<p>After p.12</p>
<pre><tt>const error_code& code() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.13</p>
<pre><tt>const char *what() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>20.9 Memory</h2>

<h4>Header <tt>&lt;memory&gt;</tt> synopsis</h4>
<pre><tt>
namespace std {
  <em>// 20.9.1, allocator argument tag</em>
  struct allocator_arg_t { };
  constexpr allocator_arg_t allocator_arg = allocator_arg_t();

  <em>// 20.9.2, uses_allocator</em>
  template &lt;class T, class Alloc&gt; struct uses_allocator;

  <em>// 20.9.3, pointer traits</em>
  template &lt;class Ptr&gt; struct pointer_traits;
  template &lt;class T&gt; struct pointer_traits&lt;T*&gt;;

  <em>// 20.9.4, allocator traits</em>
  template &lt;class Alloc&gt; struct allocator_traits;

  <em>// 20.9.5, the default allocator:</em>
  template &lt;class T&gt; class allocator;
  template &lt;&gt; class allocator&lt;void&gt;;
  template &lt;class T, class U&gt;
    bool operator==(const allocator&lt;T&gt;&, const allocator&lt;U&gt;&) <del>throw()</del><ins>noexcept</ins>;
  template lt;class T, class U&gt;
    bool operator!=(const allocator&lt;T&gt;&, const allocator&lt;U&gt;&) <del>throw()</del><ins>noexcept</ins>;

  <em>... Rest of synopsis</em>
}
</tt></pre>

<h2>20.9.5 The default allocator</h2>
<pre><tt>
namespace std {
  template &lt;class T&gt; class allocator;

  // specialize for void:
  template &lt;&gt; class allocator&lt;void&gt; {
  public:
    typedef void* pointer;
    typedef const void* const_pointer;
    <em>// reference-to-void members are impossible.</em>
    typedef void value_type;
    template &lt;class U&gt; struct rebind { typedef allocator&lt;U&gt; other; };
  };

  template &lt;class T&gt; class allocator {
  public:
    typedef size_t size_type;
    typedef ptrdiff_t difference_type;
    typedef T* pointer;
    typedef const T* const_pointer;
    typedef T& reference;
    typedef const T& const_reference;
    typedef T value_type;
    template &lt;class U&gt; struct rebind { typedef allocator&lt;U&gt; other; };

    allocator() <del>throw()</del><ins>noexcept</ins>;
    allocator(const allocator&) <del>throw()</del><ins>noexcept</ins>;
    template &lt;class U&gt; allocator(const allocator&lt;U&gt;&) <del>throw()</del><ins>noexcept</ins>;
    ~allocator() <del>throw()</del><ins>noexcept</ins>;

    pointer address(reference x) const;
    const_pointer address(const_reference x) const;

    pointer allocate(size_type, allocator&lt;void&gt;::const_pointer hint = 0);
    void deallocate(pointer p, size_type n);
    size_type max_size() const <del>throw()</del><ins>noexcept</ins>;

    template&lt;class U, class... Args&gt;
      void construct(U* p, Args&&... args);
    template &lt;class U&gt;
      void destroy(U* p);
  };
}
</tt></pre>

<p>After p.10</p>
<pre><tt>size_type max_size() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>20.9.5.2 allocator globals</h2>
<p>Before p.1</p>
<pre><tt>
template &lt;class T1, class T2&gt;
bool operator==(const allocator&lt;T1&gt;&, const allocator&lt;T2&gt;&) <del>throw()</del><ins>noexcept</ins>;
</tt></pre>
<p>After p.1</p>
<pre><tt>
template &lt;class T1, class T2&gt;
bool operator!=(const allocator&lt;T1&gt;&, const allocator&lt;T2&gt;&) <del>throw()</del><ins>noexcept</ins>;
</tt></pre>

<h2>22.2 Header <tt>&lt;locale&gt;</tt> synopsis</h2>
<pre><tt>
namespace std {
  <em>// 22.3.1, locale:</em>
  class locale;
  template &lt;class Facet&gt; const Facet& use_facet(const locale&);
  template &lt;class Facet&gt; bool has_facet(const locale&) <del>throw()</del><ins>noexcept</ins>;

  <em>... Rest of synopsis</em>
}
</tt></pre>

<h2>22.3.1 Class <tt>locale</tt></h2>
<pre><tt>
namespace std {
  class locale {
  public:
    <em>// types:</em>
    class facet;
    class id;
    typedef int category;
    static const category <em>// values assigned here are for exposition only</em>
      none = 0,
      collate = 0x010, ctype = 0x020,
      monetary = 0x040, numeric = 0x080,
      time = 0x100, messages = 0x200,
      all = collate | ctype | monetary | numeric | time | messages;

    <em>// construct/copy/destroy:</em>
    locale() <del>throw()</del><ins>noexcept</ins>;
    locale(const locale& other) <del>throw()</del><ins>noexcept</ins>;
    explicit locale(const char* std_name);
    explicit locale(const string& std_name);
    locale(const locale& other, const char* std_name, category);
    locale(const locale& other, const string& std_name, category);
    template &lt;class Facet&gt; locale(const locale& other, Facet* f);
    locale(const locale& other, const locale& one, category);
    ~locale() <del>throw()</del><ins>noexcept</ins>; <em>// not virtual</em>
    const locale& operator=(const locale& other) <del>throw()</del><ins>noexcept</ins>;
    template &lt;class Facet&gt; locale combine(const locale& other) const;

    <em>// locale operations:</em>
    basic_string&lt;char&gt; name() const;

    bool operator==(const locale& other) const;
    bool operator!=(const locale& other) const;

    template &lt;class charT, class Traits, class Allocator&gt;
      bool operator()(const basic_string&lt;charT,Traits,Allocator&gt;& s1,
                      const basic_string&lt;charT,Traits,Allocator&gt;& s2) const;

    <em>// global locale objects:</em>
    static locale global(const locale&);
    static const locale& classic();
  };
}
</tt></pre>

<h2>22.3.1.2 <tt>locale</tt> constructors and destructor</h2>

<p>Before p.1</p>
<pre><tt>locale() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.2</p>
<pre><tt>locale(const locale& other) <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.3</p>
<pre><tt>const locale& operator=(const locale& other) <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.17</p>
<pre><tt>~locale() <del>throw()</del>;</tt></pre>

<h2>22.3.2 <tt>locale</tt> globals</h2>
<p>After p.4</p>
<pre><tt>template <class Facet> bool has_facet(const locale& loc) <del>throw()</del><ins>noexcept</ins>;</pre></tt>

<h2>22.4.1.3 <tt>ctype</tt> specializations</h2>
<pre><tt>
namespace std {
  template &lt;&gt; class ctype&lt;char&gt;
    : public locale::facet, public ctype_base {
  public:
    typedef char char_type;

    <em>...</em>

    const mask* table() const <del>throw()</del><ins>noexcept</ins>;
    static const mask* classic_table() <del>throw()</del><ins>noexcept</ins>;

    <em>...</em>
  };
}
</tt></pre>

<h2>22.4.1.3.2 <tt>ctype&lt;char&gt;</tt> members</h2>
<p>After p.11</p>
<pre><tt>const mask* table() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>22.4.1.3.3 <tt>ctype&lt;char&gt;</tt> static members</h2>
<p>Before p.1</p>
<pre><tt>static const mask* classic_table() <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>22.4.1.4 Class template <tt>codecvt</tt></h2>
<pre><tt>
namespace std {
  class codecvt_base {
  public:
    enum result { ok, partial, error, noconv };
  };

  template &lt;class internT, class externT, class stateT&gt;
    class codecvt : public locale::facet, public codecvt_base {
  public:
    typedef internT intern_type;
    typedef externT extern_type;
    typedef stateT state_type;

    explicit codecvt(size_t refs = 0);

    result out(stateT& state, 
               const internT* from, const internT* from_end, const internT*& from_next, 
               externT* to, externT* to_end, externT*& to_next) const;
    result unshift(stateT& state,
                   externT* to, externT* to_end, externT*& to_next) const;
    result in(stateT& state,
              const externT* from, const externT* from_end, const externT*& from_next,
              internT* to, internT* to_end, internT*& to_next) const;
    int encoding() const <del>throw()</del><ins>noexcept</ins>;
    bool always_noconv() const <del>throw()</del><ins>noexcept</ins>;
    int length(stateT&, const externT* from, const externT* end,
               size_t max) const;
    int max_length() const <del>throw()</del><ins>noexcept</ins>;

    static locale::id id;

  protected:
    ~codecvt();
    virtual result do_out(stateT& state,
                          const internT* from, const internT* from_end, const internT*& from_next,
                          externT* to, externT* to_end, externT*& to_next) const;
    virtual result do_in(stateT& state,
                         const externT* from, const externT* from_end, const externT*& from_next,
                         internT* to, internT* to_end, internT*& to_next) const;
    virtual result do_unshift(stateT& state,
                              externT* to, externT* to_end, externT*& to_next) const;
    virtual int do_encoding() const <del>throw()</del><ins>noexcept</ins>;
    virtual bool do_always_noconv() const <del>throw()</del><ins>noexcept</ins>;
    virtual int do_length(stateT&, const externT* from,
                          const externT* end, size_t max) const;
    virtual int do_max_length() const <del>throw()</del><ins>noexcept</ins>;
  };
}
</tt></pre>

<h2>22.4.1.4.1 <tt>codecvt</tt> members</h2>
<p>After p.3</p>
<pre><tt>int encoding() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.4</p>
<pre><tt>bool always_noconv() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.6</p>
<pre><tt>int max_length() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>22.4.1.4.2 <tt>codecvt</tt> virtual functions</h2>
<p>After p.8</p>
<pre><tt>int do_encoding() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.9</p>
<pre><tt>bool do_always_noconv() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.13</p>
<pre><tt>int do_max_length() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>24.6.3 Class template <tt>istreambuf_iterator</tt></h2>
<p>2. The result of operator*() on an end-of-stream iterator is undefined. For any other iterator value a char_-
type value is returned. It is impossible to assign a character via an input iterator.
<pre><tt>
namespace std {
  template&lt;class charT, class traits = char_traits&lt;charT&gt; &gt;
  class istreambuf_iterator
    : public iterator&lt;input_iterator_tag, charT,
                         typename traits::off_type, unspecified , charT&gt; {
  public:
    typedef charT char_type;
    typedef traits traits_type;
    typedef typename traits::int_type int_type;
    typedef basic_streambuf&lt;charT,traits&gt; streambuf_type;
    typedef basic_istream&lt;charT,traits&gt; istream_type;

    class proxy; <em>// exposition only</em>

    constexpr istreambuf_iterator() <del>throw()</del><ins>noexcept</ins>;
    istreambuf_iterator(const istreambuf_iterator&) <del>throw()</del> = default;
    ~istreambuf_iterator() <del>throw()</del> = default;
    istreambuf_iterator(istream_type& s) <del>throw()</del><ins>noexcept</ins>;
    istreambuf_iterator(streambuf_type* s) <del>throw()</del><ins>noexcept</ins>;
    istreambuf_iterator(const proxy& p) <del>throw()</del><ins>noexcept</ins>;
    charT operator*() const;
    pointer operator-&gt;() const;
    istreambuf_iterator&lt;charT,traits&gt;& operator++();
    proxy operator++(int);
    bool equal(const istreambuf_iterator& b) const;
  private:
    streambuf_type* sbuf_; <em>// exposition only</em>
  };

  template &lt;class charT, class traits&gt;
    bool operator==(const istreambuf_iterator&lt;charT,traits&gt;& a,
                    const istreambuf_iterator&lt;charT,traits&gt;& b);
  template &lt;class charT, class traits&gt;
    bool operator!=(const istreambuf_iterator&lt;charT,traits&gt;& a,
                    const istreambuf_iterator&lt;charT,traits&gt;& b);
}
</tt></pre>

<h2>24.6.3.2 <tt>istreambuf_iterator</tt> constructors</h2>
<p>Before p.1</p>
<pre><tt>constexpr istreambuf_iterator() <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.1</p>
<pre><tt>
istreambuf_iterator(basic_istream<charT,traits>& s) <del>throw()</del><ins>noexcept</ins>;
istreambuf_iterator(basic_streambuf<charT,traits>* s) <del>throw()</del><ins>noexcept</ins>;
</tt></pre>
<p>After p.2</p>
<pre><tt>istreambuf_iterator(const proxy& p) <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>24.6.4 Class template <tt>ostreambuf_iterator</tt></h2>
<pre><tt>
namespace std {
  template &lt;class charT, class traits = char_traits&lt;charT&gt; &gt;
  class ostreambuf_iterator :
    public iterator&lt;output_iterator_tag, void, void, void, void&gt; {
  public:
    typedef charT char_type;
    typedef traits traits_type;
    typedef basic_streambuf&lt;charT,traits&gt; streambuf_type;
    typedef basic_ostream&lt;charT,traits&gt; ostream_type;
  public:
    ostreambuf_iterator(ostream_type& s) <del>throw()</del><ins>noexcept</ins>;
    ostreambuf_iterator(streambuf_type* s) <del>throw()</del><ins>noexcept</ins>;
    ostreambuf_iterator& operator=(charT c);
    ostreambuf_iterator& operator*();
    ostreambuf_iterator& operator++();
    ostreambuf_iterator& operator++(int);
    bool failed() const <del>throw()</del><ins>noexcept</ins>;
  private:
    streambuf_type* sbuf_; <em>// exposition only</em>
  };
}
</tt></pre>

<h2>24.6.4.1 <tt>ostreambuf_iterator</tt> constructors</h2>
<p>Before p.1</p>
<pre><tt>ostreambuf_iterator(ostream_type& s) <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.2</p>
<pre><tt>ostreambuf_iterator(streambuf_type* s) <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>24.6.4.2 <tt>ostreambuf_iterator</tt> operations</h2>
<p>After p.4</p>
<pre><tt>bool failed() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>

<h2>30.6.3 Class <tt>future_error</tt></h2>
<pre><tt>
namespace std {
  class future_error : public logic_error {
    public:
      future_error(error_code ec); // exposition only
      const error_code& code() const <del>throw()</del><ins>noexcept</ins>;
      const char* what() const <del>throw()</del><ins>noexcept</ins>;
  };
}
</tt></pre>

<p>Before p.1</p>
<pre><tt>const error_code& code() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>
<p>After p.1</p>
<pre><tt>const char *what() const <del>throw()</del><ins>noexcept</ins>;</tt></pre>



</body>
</html>
