blob: 06dccdb1f588b7d40a56871f609db05fe0c7ce43 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
2//
Howard Hinnantf5256e12010-05-11 21:36:01 +00003// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00004//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <map>
11
12// class multimap
13
14// multimap(initializer_list<value_type> il, const key_compare& comp = key_compare());
15
16#include <map>
17#include <cassert>
18
19int main()
20{
Howard Hinnant73d21a42010-09-04 23:28:19 +000021#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000022 typedef std::multimap<int, double> C;
23 typedef C::value_type V;
24 C m =
25 {
26 {1, 1},
27 {1, 1.5},
28 {1, 2},
29 {2, 1},
30 {2, 1.5},
31 {2, 2},
32 {3, 1},
33 {3, 1.5},
34 {3, 2}
35 };
36 assert(m.size() == 9);
37 assert(distance(m.begin(), m.end()) == 9);
38 C::const_iterator i = m.cbegin();
39 assert(*i == V(1, 1));
40 assert(*++i == V(1, 1.5));
41 assert(*++i == V(1, 2));
42 assert(*++i == V(2, 1));
43 assert(*++i == V(2, 1.5));
44 assert(*++i == V(2, 2));
45 assert(*++i == V(3, 1));
46 assert(*++i == V(3, 1.5));
47 assert(*++i == V(3, 2));
Howard Hinnant73d21a42010-09-04 23:28:19 +000048#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000049}