14684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
24684ddb6SLionel Sambuc //
34684ddb6SLionel Sambuc //                     The LLVM Compiler Infrastructure
44684ddb6SLionel Sambuc //
54684ddb6SLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
64684ddb6SLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
74684ddb6SLionel Sambuc //
84684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
94684ddb6SLionel Sambuc 
104684ddb6SLionel Sambuc // <map>
114684ddb6SLionel Sambuc 
124684ddb6SLionel Sambuc // class multimap
134684ddb6SLionel Sambuc 
144684ddb6SLionel Sambuc // multimap(const multimap& m);
154684ddb6SLionel Sambuc 
164684ddb6SLionel Sambuc #include <map>
174684ddb6SLionel Sambuc #include <cassert>
184684ddb6SLionel Sambuc 
194684ddb6SLionel Sambuc #include "../../../test_compare.h"
20*0a6a1f1dSLionel Sambuc #include "test_allocator.h"
21*0a6a1f1dSLionel Sambuc #include "min_allocator.h"
224684ddb6SLionel Sambuc 
main()234684ddb6SLionel Sambuc int main()
244684ddb6SLionel Sambuc {
254684ddb6SLionel Sambuc     {
264684ddb6SLionel Sambuc         typedef std::pair<const int, double> V;
274684ddb6SLionel Sambuc         V ar[] =
284684ddb6SLionel Sambuc         {
294684ddb6SLionel Sambuc             V(1, 1),
304684ddb6SLionel Sambuc             V(1, 1.5),
314684ddb6SLionel Sambuc             V(1, 2),
324684ddb6SLionel Sambuc             V(2, 1),
334684ddb6SLionel Sambuc             V(2, 1.5),
344684ddb6SLionel Sambuc             V(2, 2),
354684ddb6SLionel Sambuc             V(3, 1),
364684ddb6SLionel Sambuc             V(3, 1.5),
374684ddb6SLionel Sambuc             V(3, 2),
384684ddb6SLionel Sambuc         };
394684ddb6SLionel Sambuc         typedef test_compare<std::less<int> > C;
404684ddb6SLionel Sambuc         typedef test_allocator<V> A;
414684ddb6SLionel Sambuc         std::multimap<int, double, C, A> mo(ar, ar+sizeof(ar)/sizeof(ar[0]), C(5), A(7));
424684ddb6SLionel Sambuc         std::multimap<int, double, C, A> m = mo;
434684ddb6SLionel Sambuc         assert(m == mo);
444684ddb6SLionel Sambuc         assert(m.get_allocator() == A(7));
454684ddb6SLionel Sambuc         assert(m.key_comp() == C(5));
464684ddb6SLionel Sambuc 
474684ddb6SLionel Sambuc         assert(mo.get_allocator() == A(7));
484684ddb6SLionel Sambuc         assert(mo.key_comp() == C(5));
494684ddb6SLionel Sambuc     }
504684ddb6SLionel Sambuc #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
514684ddb6SLionel Sambuc     {
524684ddb6SLionel Sambuc         typedef std::pair<const int, double> V;
534684ddb6SLionel Sambuc         V ar[] =
544684ddb6SLionel Sambuc         {
554684ddb6SLionel Sambuc             V(1, 1),
564684ddb6SLionel Sambuc             V(1, 1.5),
574684ddb6SLionel Sambuc             V(1, 2),
584684ddb6SLionel Sambuc             V(2, 1),
594684ddb6SLionel Sambuc             V(2, 1.5),
604684ddb6SLionel Sambuc             V(2, 2),
614684ddb6SLionel Sambuc             V(3, 1),
624684ddb6SLionel Sambuc             V(3, 1.5),
634684ddb6SLionel Sambuc             V(3, 2),
644684ddb6SLionel Sambuc         };
654684ddb6SLionel Sambuc         typedef test_compare<std::less<int> > C;
664684ddb6SLionel Sambuc         typedef other_allocator<V> A;
674684ddb6SLionel Sambuc         std::multimap<int, double, C, A> mo(ar, ar+sizeof(ar)/sizeof(ar[0]), C(5), A(7));
684684ddb6SLionel Sambuc         std::multimap<int, double, C, A> m = mo;
694684ddb6SLionel Sambuc         assert(m == mo);
704684ddb6SLionel Sambuc         assert(m.get_allocator() == A(-2));
714684ddb6SLionel Sambuc         assert(m.key_comp() == C(5));
724684ddb6SLionel Sambuc 
734684ddb6SLionel Sambuc         assert(mo.get_allocator() == A(7));
744684ddb6SLionel Sambuc         assert(mo.key_comp() == C(5));
754684ddb6SLionel Sambuc     }
764684ddb6SLionel Sambuc #endif  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
774684ddb6SLionel Sambuc #if __cplusplus >= 201103L
784684ddb6SLionel Sambuc     {
794684ddb6SLionel Sambuc         typedef std::pair<const int, double> V;
804684ddb6SLionel Sambuc         V ar[] =
814684ddb6SLionel Sambuc         {
824684ddb6SLionel Sambuc             V(1, 1),
834684ddb6SLionel Sambuc             V(1, 1.5),
844684ddb6SLionel Sambuc             V(1, 2),
854684ddb6SLionel Sambuc             V(2, 1),
864684ddb6SLionel Sambuc             V(2, 1.5),
874684ddb6SLionel Sambuc             V(2, 2),
884684ddb6SLionel Sambuc             V(3, 1),
894684ddb6SLionel Sambuc             V(3, 1.5),
904684ddb6SLionel Sambuc             V(3, 2),
914684ddb6SLionel Sambuc         };
924684ddb6SLionel Sambuc         typedef test_compare<std::less<int> > C;
934684ddb6SLionel Sambuc         typedef min_allocator<V> A;
944684ddb6SLionel Sambuc         std::multimap<int, double, C, A> mo(ar, ar+sizeof(ar)/sizeof(ar[0]), C(5), A());
954684ddb6SLionel Sambuc         std::multimap<int, double, C, A> m = mo;
964684ddb6SLionel Sambuc         assert(m == mo);
974684ddb6SLionel Sambuc         assert(m.get_allocator() == A());
984684ddb6SLionel Sambuc         assert(m.key_comp() == C(5));
994684ddb6SLionel Sambuc 
1004684ddb6SLionel Sambuc         assert(mo.get_allocator() == A());
1014684ddb6SLionel Sambuc         assert(mo.key_comp() == C(5));
1024684ddb6SLionel Sambuc     }
1034684ddb6SLionel Sambuc #endif
1044684ddb6SLionel Sambuc }
105