diff options
Diffstat (limited to 'test/std/containers/associative/map/map.special')
3 files changed, 15 insertions, 17 deletions
diff --git a/test/std/containers/associative/map/map.special/member_swap.pass.cpp b/test/std/containers/associative/map/map.special/member_swap.pass.cpp index 7c3ad9d50ae4..f0913a77c2eb 100644 --- a/test/std/containers/associative/map/map.special/member_swap.pass.cpp +++ b/test/std/containers/associative/map/map.special/member_swap.pass.cpp @@ -96,7 +96,7 @@ int main() assert(m2 == m1_save); } } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { typedef std::map<int, double, std::less<int>, min_allocator<V>> M; { diff --git a/test/std/containers/associative/map/map.special/non_member_swap.pass.cpp b/test/std/containers/associative/map/map.special/non_member_swap.pass.cpp index b042a4878f8a..103a57b17e07 100644 --- a/test/std/containers/associative/map/map.special/non_member_swap.pass.cpp +++ b/test/std/containers/associative/map/map.special/non_member_swap.pass.cpp @@ -98,6 +98,7 @@ int main() assert(m1 == m2_save); assert(m2 == m1_save); } + } { typedef test_allocator<V> A; typedef test_compare<std::less<int> > C; @@ -166,8 +167,7 @@ int main() assert(m2.key_comp() == C(1)); assert(m2.get_allocator() == A(1)); } - } -#if __cplusplus >= 201103L +#if TEST_STD_VER >= 11 { typedef std::map<int, double, std::less<int>, min_allocator<V>> M; { @@ -242,6 +242,7 @@ int main() assert(m1 == m2_save); assert(m2 == m1_save); } + } { typedef min_allocator<V> A; typedef test_compare<std::less<int> > C; @@ -276,6 +277,5 @@ int main() assert(m2.key_comp() == C(1)); assert(m2.get_allocator() == A()); } - } #endif } diff --git a/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp b/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp index f25dff2c86da..cbbf4577ce62 100644 --- a/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp +++ b/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // <map> // void swap(map& 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 <map> #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::pair<const MoveOnly, MoveOnly> V; { typedef std::map<MoveOnly, MoveOnly> C; @@ -145,5 +144,4 @@ int main() } #endif -#endif } |
