aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/array
diff options
context:
space:
mode:
authorVille Voutilainen <ville.voutilainen@gmail.com>2015-06-05 17:44:26 +0300
committerJonathan Wakely <redi@gcc.gnu.org>2015-06-05 15:44:26 +0100
commitddb63209a8dc059a7b2a137d7a1859222bb43dd6 (patch)
tree3ceea62da88739a862bf476777be8b79b37f00a6 /libstdc++-v3/include/std/array
parentac59f9beec4e2f44bd3c04eb8f4fb9432feaea40 (diff)
downloadgcc-ddb63209a8dc059a7b2a137d7a1859222bb43dd6.zip
gcc-ddb63209a8dc059a7b2a137d7a1859222bb43dd6.tar.gz
gcc-ddb63209a8dc059a7b2a137d7a1859222bb43dd6.tar.bz2
Add __is_nothrow_swappable and take it into use.
2015-06-04 Ville Voutilainen <ville.voutilainen@gmail.com> Add __is_nothrow_swappable and take it into use. * include/bits/algorithmfwd.h (swap): Only declare for C++98 mode. * include/bits/move.h (swap): Add constraints in C++11 and later. * include/bits/stl_pair.h (swap): Use __is_nothrow_swappable for the free swap function for pair. * include/bits/stl_queue.h (swap): Use __is_nothrow_swappable for the free swap functions for queue and priority_queue. * include/bits/stl_stack.h (swap): Use __is_nothrow_swappable for the free swap function for stack. * include/debug/array (swap): Use __is_nothrow_swappable for the free swap function for array. * include/profile/array (swap): Likewise. * include/std/array (swap): Likewise. * include/std/tuple (_Tuple_impl::_M_swap): Use __is_nothrow_swappable. * include/std/type_traits (__is_swappable_impl::__is_swappable, __is_nothrow_swappable_impl, __is_nothrow_swappable): New. * testsuite/20_util/is_nothrow_swappable/requirements/ explicit_instantiation.cc: New. * testsuite/20_util/is_nothrow_swappable/requirements/typedefs.cc: New. * testsuite/20_util/is_nothrow_swappable/value.cc: New. From-SVN: r224153
Diffstat (limited to 'libstdc++-v3/include/std/array')
-rw-r--r--libstdc++-v3/include/std/array2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/array b/libstdc++-v3/include/std/array
index 24be44f..40fbd46 100644
--- a/libstdc++-v3/include/std/array
+++ b/libstdc++-v3/include/std/array
@@ -113,7 +113,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
void
swap(array& __other)
- noexcept(noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>())))
+ noexcept(__is_nothrow_swappable<_Tp>::value)
{ std::swap_ranges(begin(), end(), __other.begin()); }
// Iterators.