summaryrefslogtreecommitdiffstats
path: root/libcxx/include/unordered_set
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-07-13 20:04:56 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-07-13 20:04:56 +0000
commite3fbe1433b02d52a833b06219184ee4f4852b50a (patch)
treeb1be725f7d35363bf0681fd6fd3f4938fe0a37d5 /libcxx/include/unordered_set
parent75a7e435813d28751f9555a11dd171e389be2d1e (diff)
downloadbcm5719-llvm-e3fbe1433b02d52a833b06219184ee4f4852b50a.tar.gz
bcm5719-llvm-e3fbe1433b02d52a833b06219184ee4f4852b50a.zip
Implement the first part of N4258: 'Cleaning up noexcept in the Library'. This patch deals with swapping containers, and implements a more strict noexcept specification (a conforming extension) than the standard mandates.
llvm-svn: 242056
Diffstat (limited to 'libcxx/include/unordered_set')
-rw-r--r--libcxx/include/unordered_set16
1 files changed, 6 insertions, 10 deletions
diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set
index 26ef6fd6af1..f6ccdc3734f 100644
--- a/libcxx/include/unordered_set
+++ b/libcxx/include/unordered_set
@@ -120,11 +120,9 @@ public:
void clear() noexcept;
void swap(unordered_set&)
- noexcept(
- (!allocator_type::propagate_on_container_swap::value ||
- __is_nothrow_swappable<allocator_type>::value) &&
- __is_nothrow_swappable<hasher>::value &&
- __is_nothrow_swappable<key_equal>::value);
+ noexcept(allocator_traits<Allocator>::is_always_equal::value &&
+ noexcept(swap(declval<hasher&>(), declval<hasher&>())) &&
+ noexcept(swap(declval<key_equal&>(), declval<key_equal&>()))); // C++17
hasher hash_function() const;
key_equal key_eq() const;
@@ -270,11 +268,9 @@ public:
void clear() noexcept;
void swap(unordered_multiset&)
- noexcept(
- (!allocator_type::propagate_on_container_swap::value ||
- __is_nothrow_swappable<allocator_type>::value) &&
- __is_nothrow_swappable<hasher>::value &&
- __is_nothrow_swappable<key_equal>::value);
+ noexcept(allocator_traits<Allocator>::is_always_equal::value &&
+ noexcept(swap(declval<hasher&>(), declval<hasher&>())) &&
+ noexcept(swap(declval<key_equal&>(), declval<key_equal&>()))); // C++17
hasher hash_function() const;
key_equal key_eq() const;
OpenPOWER on IntegriCloud