| 1 | #include <QMultiHash> |
| 2 | int main() |
| 3 | { |
| 4 | QMultiHash<int, int> h; |
| 5 | h[10] = 100; |
| 6 | h[20] = 200; |
| 7 | h[30] = 300; |
| 8 | |
| 9 | h.insert(10, 123); |
| 10 | h.insert(30, 82); |
| 11 | h.insert(4, 99); |
| 12 | h.insert(10, 0); |
| 13 | h.insert(30, 300); // insert another element {30, 300} |
| 14 | h.remove(20, 200); // should remove the now-empty node |
| 15 | |
| 16 | return 0; |
| 17 | } |