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(initializer_list<value_type> il, const key_compare& comp = key_compare());
154684ddb6SLionel Sambuc 
164684ddb6SLionel Sambuc #include <map>
174684ddb6SLionel Sambuc #include <cassert>
184684ddb6SLionel Sambuc 
19*0a6a1f1dSLionel Sambuc #include "min_allocator.h"
204684ddb6SLionel Sambuc 
main()214684ddb6SLionel Sambuc int main()
224684ddb6SLionel Sambuc {
234684ddb6SLionel Sambuc #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
244684ddb6SLionel Sambuc     {
254684ddb6SLionel Sambuc     typedef std::multimap<int, double> C;
264684ddb6SLionel Sambuc     typedef C::value_type V;
274684ddb6SLionel Sambuc     C m =
284684ddb6SLionel Sambuc            {
294684ddb6SLionel Sambuc                {1, 1},
304684ddb6SLionel Sambuc                {1, 1.5},
314684ddb6SLionel Sambuc                {1, 2},
324684ddb6SLionel Sambuc                {2, 1},
334684ddb6SLionel Sambuc                {2, 1.5},
344684ddb6SLionel Sambuc                {2, 2},
354684ddb6SLionel Sambuc                {3, 1},
364684ddb6SLionel Sambuc                {3, 1.5},
374684ddb6SLionel Sambuc                {3, 2}
384684ddb6SLionel Sambuc            };
394684ddb6SLionel Sambuc     assert(m.size() == 9);
404684ddb6SLionel Sambuc     assert(distance(m.begin(), m.end()) == 9);
414684ddb6SLionel Sambuc     C::const_iterator i = m.cbegin();
424684ddb6SLionel Sambuc     assert(*i == V(1, 1));
434684ddb6SLionel Sambuc     assert(*++i == V(1, 1.5));
444684ddb6SLionel Sambuc     assert(*++i == V(1, 2));
454684ddb6SLionel Sambuc     assert(*++i == V(2, 1));
464684ddb6SLionel Sambuc     assert(*++i == V(2, 1.5));
474684ddb6SLionel Sambuc     assert(*++i == V(2, 2));
484684ddb6SLionel Sambuc     assert(*++i == V(3, 1));
494684ddb6SLionel Sambuc     assert(*++i == V(3, 1.5));
504684ddb6SLionel Sambuc     assert(*++i == V(3, 2));
514684ddb6SLionel Sambuc     }
524684ddb6SLionel Sambuc #if __cplusplus >= 201103L
534684ddb6SLionel Sambuc     {
544684ddb6SLionel Sambuc     typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
554684ddb6SLionel Sambuc     typedef C::value_type V;
564684ddb6SLionel Sambuc     C m =
574684ddb6SLionel Sambuc            {
584684ddb6SLionel Sambuc                {1, 1},
594684ddb6SLionel Sambuc                {1, 1.5},
604684ddb6SLionel Sambuc                {1, 2},
614684ddb6SLionel Sambuc                {2, 1},
624684ddb6SLionel Sambuc                {2, 1.5},
634684ddb6SLionel Sambuc                {2, 2},
644684ddb6SLionel Sambuc                {3, 1},
654684ddb6SLionel Sambuc                {3, 1.5},
664684ddb6SLionel Sambuc                {3, 2}
674684ddb6SLionel Sambuc            };
684684ddb6SLionel Sambuc     assert(m.size() == 9);
694684ddb6SLionel Sambuc     assert(distance(m.begin(), m.end()) == 9);
704684ddb6SLionel Sambuc     C::const_iterator i = m.cbegin();
714684ddb6SLionel Sambuc     assert(*i == V(1, 1));
724684ddb6SLionel Sambuc     assert(*++i == V(1, 1.5));
734684ddb6SLionel Sambuc     assert(*++i == V(1, 2));
744684ddb6SLionel Sambuc     assert(*++i == V(2, 1));
754684ddb6SLionel Sambuc     assert(*++i == V(2, 1.5));
764684ddb6SLionel Sambuc     assert(*++i == V(2, 2));
774684ddb6SLionel Sambuc     assert(*++i == V(3, 1));
784684ddb6SLionel Sambuc     assert(*++i == V(3, 1.5));
794684ddb6SLionel Sambuc     assert(*++i == V(3, 2));
804684ddb6SLionel Sambuc     }
814684ddb6SLionel Sambuc #endif
824684ddb6SLionel Sambuc #endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
834684ddb6SLionel Sambuc }
84