diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2013-09-11 01:15:47 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2013-09-11 01:15:47 +0000 |
| commit | fbc317d4807afe41f4ea00947419a99cbdec4a2e (patch) | |
| tree | 765e75279932a03499f010fdbc0a42802f54f5ed /libcxx/test/containers/associative/map | |
| parent | 6cf2e861398dd8d9958401c202b2c8cc43e5e667 (diff) | |
| download | bcm5719-llvm-fbc317d4807afe41f4ea00947419a99cbdec4a2e.tar.gz bcm5719-llvm-fbc317d4807afe41f4ea00947419a99cbdec4a2e.zip | |
LWG Issue #2210 Part 5 - map/multimap; no, really - the last one was set/multiset. THIS is map/multimap
llvm-svn: 190474
Diffstat (limited to 'libcxx/test/containers/associative/map')
| -rw-r--r-- | libcxx/test/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp | 26 | ||||
| -rw-r--r-- | libcxx/test/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp | 29 |
2 files changed, 55 insertions, 0 deletions
diff --git a/libcxx/test/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp b/libcxx/test/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp index 14e0eb3d4f7..d844624560e 100644 --- a/libcxx/test/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp +++ b/libcxx/test/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp @@ -69,6 +69,32 @@ int main() assert(m.key_comp() == C(3)); assert(m.get_allocator() == A()); } +#if _LIBCPP_STD_VER > 11 + { + typedef std::pair<const int, double> V; + typedef min_allocator<V> A; + typedef test_compare<std::less<int> > C; + typedef std::map<int, double, C, A> M; + A a; + M m ({ {1, 1}, + {1, 1.5}, + {1, 2}, + {2, 1}, + {2, 1.5}, + {2, 2}, + {3, 1}, + {3, 1.5}, + {3, 2} + }, a); + + assert(m.size() == 3); + assert(distance(m.begin(), m.end()) == 3); + assert(*m.begin() == V(1, 1)); + assert(*next(m.begin()) == V(2, 1)); + assert(*next(m.begin(), 2) == V(3, 1)); + assert(m.get_allocator() == a); + } +#endif #endif #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS } diff --git a/libcxx/test/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp b/libcxx/test/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp index 8fabdcc087d..2c767123af1 100644 --- a/libcxx/test/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp +++ b/libcxx/test/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp @@ -75,5 +75,34 @@ int main() assert(*next(m.begin()) == V(2, 1)); assert(*next(m.begin(), 2) == V(3, 1)); } +#if _LIBCPP_STD_VER > 11 + { + typedef std::pair<const int, double> V; + V ar[] = + { + V(1, 1), + V(1, 1.5), + V(1, 2), + V(2, 1), + V(2, 1.5), + V(2, 2), + V(3, 1), + V(3, 1.5), + V(3, 2), + }; + typedef std::pair<const int, double> V; + typedef min_allocator<V> A; + typedef test_compare<std::less<int> > C; + A a; + std::map<int, double, C, A> m(ar, ar+sizeof(ar)/sizeof(ar[0]), a ); + + assert(m.size() == 3); + assert(distance(m.begin(), m.end()) == 3); + assert(*m.begin() == V(1, 1)); + assert(*next(m.begin()) == V(2, 1)); + assert(*next(m.begin(), 2) == V(3, 1)); + assert(m.get_allocator() == a); + } +#endif #endif } |

