diff mbox

Fix zero size debug array swap noexcept qualification

Message ID 576C44F6.608@gmail.com
State New
Headers show

Commit Message

François Dumont June 23, 2016, 8:22 p.m. UTC
Debug mode array had simply been forgotten when fixing zero-size 
swap method as part of swappable traits implementation.

     * include/debug/array (array<>::swap): Fix noexcept qualificaton for
     zero-size array.

     Tested under Linux x86_64 debug mode.

François

Comments

Jonathan Wakely June 27, 2016, 12:46 p.m. UTC | #1
On 23/06/16 22:22 +0200, François Dumont wrote:
>    Debug mode array had simply been forgotten when fixing zero-size 
>swap method as part of swappable traits implementation.
>
>    * include/debug/array (array<>::swap): Fix noexcept qualificaton for
>    zero-size array.
>
>    Tested under Linux x86_64 debug mode.

OK for trunk, thanks.
diff mbox

Patch

Index: include/debug/array
===================================================================
--- include/debug/array	(revision 237614)
+++ include/debug/array	(working copy)
@@ -86,7 +86,7 @@ 
 
       void
       swap(array& __other)
-      noexcept(__is_nothrow_swappable<_Tp>::value)
+      noexcept(_AT_Type::_Is_nothrow_swappable::value)
       { std::swap_ranges(begin(), end(), __other.begin()); }
 
       // Iterators.
@@ -168,9 +168,8 @@ 
       at(size_type __n)
       {
 	if (__n >= _Nm)
-	  std::__throw_out_of_range_fmt(__N("array::at: __n "
-				            "(which is %zu) >= _Nm "
-					    "(which is %zu)"),
+	  std::__throw_out_of_range_fmt(__N("array::at: __n (which is %zu) "
+					    ">= _Nm (which is %zu)"),
 					__n, _Nm);
 	return _AT_Type::_S_ref(_M_elems, __n);
       }