diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:47:26 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:47:26 +0000 |
commit | 51072bd6bf79ef2bc6a922079bff57c31c1effbc (patch) | |
tree | 91a2effbc9e6f80bdbbf9eb70e06c51ad0867ea0 /test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp | |
parent | bb5e33f003797b67974a8893f7f2930fc51b8210 (diff) |
Notes
Diffstat (limited to 'test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp')
-rw-r--r-- | test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp b/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp index 3ec6976127545..0eb7d871b8b48 100644 --- a/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp +++ b/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <set> // void swap(set& 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::set<MoveOnly> C; C c1, c2; @@ -144,5 +143,4 @@ int main() } #endif -#endif } |