diff options
Diffstat (limited to 'libcxx/test/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp')
| -rw-r--r-- | libcxx/test/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libcxx/test/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp b/libcxx/test/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp index a83e2ae581d..b6d25d6ec5f 100644 --- a/libcxx/test/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp +++ b/libcxx/test/containers/associative/multiset/multiset.cons/iter_iter_alloc.pass.cpp @@ -55,4 +55,38 @@ int main() assert(*next(m.begin(), 6) == 3); assert(*next(m.begin(), 7) == 3); assert(*next(m.begin(), 8) == 3); +#if _LIBCPP_STD_VER > 11 + { + typedef int V; + V ar[] = + { + 1, + 1, + 1, + 2, + 2, + 2, + 3, + 3, + 3 + }; + typedef test_allocator<V> A; + typedef test_compare<std::less<int> > C; + A a; + std::multiset<V, C, A> m(ar, ar+sizeof(ar)/sizeof(ar[0]), a); + + assert(m.size() == 9); + assert(distance(m.begin(), m.end()) == 9); + assert(*next(m.begin(), 0) == 1); + assert(*next(m.begin(), 1) == 1); + assert(*next(m.begin(), 2) == 1); + assert(*next(m.begin(), 3) == 2); + assert(*next(m.begin(), 4) == 2); + assert(*next(m.begin(), 5) == 2); + assert(*next(m.begin(), 6) == 3); + assert(*next(m.begin(), 7) == 3); + assert(*next(m.begin(), 8) == 3); + assert(m.get_allocator() == a); + } +#endif } |

