diff options
Diffstat (limited to 'test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp')
-rw-r--r-- | test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp b/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp index 1056c231f0db..f8f17ffec57a 100644 --- a/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp +++ b/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <unordered_map> // void swap(unordered_map& c) @@ -26,6 +28,7 @@ #include <unordered_map> #include <cassert> +#include "test_macros.h" #include "MoveOnly.h" #include "test_allocator.h" @@ -33,20 +36,20 @@ template <class T> struct some_comp { typedef T value_type; - + some_comp() {} some_comp(const some_comp&) {} + 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 @@ -79,7 +82,7 @@ template <class T> struct some_alloc { typedef T value_type; - + some_alloc() {} some_alloc(const some_alloc&); void deallocate(void*, unsigned) {} @@ -91,7 +94,7 @@ template <class T> struct some_alloc2 { typedef T value_type; - + some_alloc2() {} some_alloc2(const some_alloc2&); void deallocate(void*, unsigned) {} @@ -104,7 +107,7 @@ template <class T> struct some_alloc3 { typedef T value_type; - + some_alloc3() {} some_alloc3(const some_alloc3&); void deallocate(void*, unsigned) {} @@ -116,7 +119,6 @@ struct some_alloc3 int main() { -#if __has_feature(cxx_noexcept) typedef std::pair<const MoveOnly, MoveOnly> MapType; { typedef std::unordered_map<MoveOnly, MoveOnly> C; @@ -195,5 +197,4 @@ int main() static_assert( noexcept(swap(c1, c2)), ""); } #endif -#endif } |