From 5d98f3d0f06ab708fef9f7019f7ffa3313c5d049 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sat, 15 Apr 2017 17:35:08 +0100 Subject: [PATCH] Noexcept specs for swap free functions --- include/boost/unordered/unordered_map.hpp | 2 ++ include/boost/unordered/unordered_map_fwd.hpp | 9 ++++++--- include/boost/unordered/unordered_set.hpp | 2 ++ include/boost/unordered/unordered_set_fwd.hpp | 6 ++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 64e5b1fd..f1d5b0df 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -1594,6 +1594,7 @@ inline bool operator!=(unordered_map const& m1, template inline void swap( unordered_map& m1, unordered_map& m2) + BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(m1.swap(m2))) { #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613)) struct dummy @@ -2003,6 +2004,7 @@ inline bool operator!=(unordered_multimap const& m1, template inline void swap(unordered_multimap& m1, unordered_multimap& m2) + BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(m1.swap(m2))) { #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613)) struct dummy diff --git a/include/boost/unordered/unordered_map_fwd.hpp b/include/boost/unordered/unordered_map_fwd.hpp index 12855e92..ebac59b4 100644 --- a/include/boost/unordered/unordered_map_fwd.hpp +++ b/include/boost/unordered/unordered_map_fwd.hpp @@ -30,7 +30,9 @@ template inline bool operator!=( unordered_map const&, unordered_map const&); template -inline void swap(unordered_map&, unordered_map&); +inline void swap( + unordered_map& m1, unordered_map& m2) + BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(m1.swap(m2))); template , class P = std::equal_to, @@ -44,8 +46,9 @@ template inline bool operator!=(unordered_multimap const&, unordered_multimap const&); template -inline void swap( - unordered_multimap&, unordered_multimap&); +inline void swap(unordered_multimap& m1, + unordered_multimap& m2) + BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(m1.swap(m2))); template class node_handle_map; template struct insert_return_type_map; diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index 40d566c2..fc35503d 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -1297,6 +1297,7 @@ inline bool operator!=( template inline void swap(unordered_set& m1, unordered_set& m2) + BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(m1.swap(m2))) { #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613)) struct dummy @@ -1681,6 +1682,7 @@ inline bool operator!=(unordered_multiset const& m1, template inline void swap( unordered_multiset& m1, unordered_multiset& m2) + BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(m1.swap(m2))) { #if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x0613)) struct dummy diff --git a/include/boost/unordered/unordered_set_fwd.hpp b/include/boost/unordered/unordered_set_fwd.hpp index d3a3b51e..24842c80 100644 --- a/include/boost/unordered/unordered_set_fwd.hpp +++ b/include/boost/unordered/unordered_set_fwd.hpp @@ -29,7 +29,8 @@ template inline bool operator!=( unordered_set const&, unordered_set const&); template -inline void swap(unordered_set& m1, unordered_set& m2); +inline void swap(unordered_set& m1, unordered_set& m2) + BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(m1.swap(m2))); template , class P = std::equal_to, class A = std::allocator > @@ -43,7 +44,8 @@ inline bool operator!=(unordered_multiset const&, unordered_multiset const&); template inline void swap( - unordered_multiset& m1, unordered_multiset& m2); + unordered_multiset& m1, unordered_multiset& m2) + BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(m1.swap(m2))); template class node_handle_set; template struct insert_return_type_set;