Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
Howard Hinnant | 5b08a8a | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 4 | // |
| 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 | // void clear(); |
| 15 | |
| 16 | #include <map> |
| 17 | #include <cassert> |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | { |
| 22 | typedef std::multimap<int, double> M; |
| 23 | typedef std::pair<int, double> P; |
| 24 | P ar[] = |
| 25 | { |
| 26 | P(1, 1.5), |
| 27 | P(2, 2.5), |
| 28 | P(3, 3.5), |
| 29 | P(4, 4.5), |
| 30 | P(5, 5.5), |
| 31 | P(6, 6.5), |
| 32 | P(7, 7.5), |
| 33 | P(8, 8.5), |
| 34 | }; |
| 35 | M m(ar, ar + sizeof(ar)/sizeof(ar[0])); |
| 36 | assert(m.size() == 8); |
| 37 | m.clear(); |
| 38 | assert(m.size() == 0); |
| 39 | } |
| 40 | } |