]>
Commit | Line | Data |
---|---|---|
f1717362 | 1 | // Copyright (C) 2005-2016 Free Software Foundation, Inc. |
e0223c57 | 2 | // |
3 | // This file is part of the GNU ISO C++ Library. This library is free | |
4 | // software; you can redistribute it and/or modify it under the | |
5 | // terms of the GNU General Public License as published by the | |
6bc9506f | 6 | // Free Software Foundation; either version 3, or (at your option) |
e0223c57 | 7 | // any later version. |
8 | // | |
9 | // This library is distributed in the hope that it will be useful, | |
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | // GNU General Public License for more details. | |
13 | // | |
14 | // You should have received a copy of the GNU General Public License along | |
6bc9506f | 15 | // with this library; see the file COPYING3. If not see |
16 | // <http://www.gnu.org/licenses/>. | |
e0223c57 | 17 | |
18 | // 6.3 Unordered associative containers | |
19 | ||
20 | #include <tr1/unordered_set> | |
21 | #include <string> | |
22 | #include <testsuite_hooks.h> | |
23 | ||
24 | // libstdc++/24054 | |
25 | void test01() | |
26 | { | |
27 | bool test __attribute__((unused)) = true; | |
28 | ||
29 | typedef std::tr1::unordered_multiset<std::string> Set; | |
30 | ||
31 | Set s; | |
32 | ||
33 | s.insert("etaoin"); | |
34 | s.insert("etaoin"); | |
35 | s.insert("etaoin"); | |
36 | s.insert("shrdlu"); | |
37 | ||
38 | VERIFY( s.erase("") == 0 ); | |
39 | VERIFY( s.size() == 4 ); | |
40 | ||
41 | VERIFY( s.erase("etaoin") == 3 ); | |
42 | VERIFY( s.size() == 1 ); | |
43 | ||
44 | VERIFY( s.erase("shrdlu") == 1 ); | |
45 | VERIFY( s.size() == 0 ); | |
46 | } | |
47 | ||
48 | int main() | |
49 | { | |
50 | test01(); | |
51 | return 0; | |
52 | } |