diff options
Diffstat (limited to 'test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp')
-rw-r--r-- | test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp b/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp index 8e2c67c9b5ec6..87639943a0b5a 100644 --- a/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp +++ b/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // void swap(multiset& c) @@ -15,13 +17,14 @@ // // In C++17, the standard says that swap shall have: // noexcept(allocator_traits<Allocator>::is_always_equal::value && -// noexcept(swap(declval<Compare&>(), declval<Compare&>()))); +// noexcept(swap(declval<Compare&>(), declval<Compare&>()))); // This tests a conforming extension #include <set> #include <cassert> +#include "test_macros.h" #include "MoveOnly.h" #include "test_allocator.h" @@ -29,23 +32,20 @@ template <class T> struct some_comp { typedef T value_type; - + some_comp() {} some_comp(const some_comp&) {} - void deallocate(void*, unsigned) {} - - typedef std::true_type propagate_on_container_swap; + bool operator()(const T&, const T&) const { return false; } }; template <class T> struct some_comp2 { typedef T value_type; - + some_comp2() {} some_comp2(const some_comp2&) {} - void deallocate(void*, unsigned) {} - typedef std::true_type propagate_on_container_swap; + bool operator()(const T&, const T&) const { return false; } }; #if TEST_STD_VER >= 14 @@ -57,7 +57,7 @@ template <class T> struct some_alloc { typedef T value_type; - + some_alloc() {} some_alloc(const some_alloc&); void deallocate(void*, unsigned) {} @@ -69,7 +69,7 @@ template <class T> struct some_alloc2 { typedef T value_type; - + some_alloc2() {} some_alloc2(const some_alloc2&); void deallocate(void*, unsigned) {} @@ -82,7 +82,7 @@ template <class T> struct some_alloc3 { typedef T value_type; - + some_alloc3() {} some_alloc3(const some_alloc3&); void deallocate(void*, unsigned) {} @@ -93,7 +93,6 @@ struct some_alloc3 int main() { -#if __has_feature(cxx_noexcept) { typedef std::multiset<MoveOnly> C; C c1, c2; @@ -143,6 +142,4 @@ int main() static_assert( noexcept(swap(c1, c2)), ""); } #endif - -#endif } |