File: hash_multimap.html

package info (click to toggle)
stl-manual 3.30-9
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,092 kB
  • ctags: 4,448
  • sloc: cpp: 17,845; ansic: 2,842; makefile: 41
file content (818 lines) | stat: -rw-r--r-- 20,827 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
<HTML>
<!--
  -- Copyright (c) 1996-1999
  -- Silicon Graphics Computer Systems, Inc.
  --
  -- Permission to use, copy, modify, distribute and sell this software
  -- and its documentation for any purpose is hereby granted without fee,
  -- provided that the above copyright notice appears in all copies and
  -- that both that copyright notice and this permission notice appear
  -- in supporting documentation.  Silicon Graphics makes no
  -- representations about the suitability of this software for any
  -- purpose.  It is provided "as is" without express or implied warranty.
  --
  -- Copyright (c) 1994
  -- Hewlett-Packard Company
  --
  -- Permission to use, copy, modify, distribute and sell this software
  -- and its documentation for any purpose is hereby granted without fee,
  -- provided that the above copyright notice appears in all copies and
  -- that both that copyright notice and this permission notice appear
  -- in supporting documentation.  Hewlett-Packard Company makes no
  -- representations about the suitability of this software for any
  -- purpose.  It is provided "as is" without express or implied warranty.
  --
  -->
<Head>
<Title>hash_multimap&lt;Key, Data, HashFcn, EqualKey, Alloc&gt;</Title>
<!-- Generated by htmldoc -->
</HEAD>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" 
	ALINK="#ff0000"> 
<IMG SRC="CorpID.gif" 
     ALT="SGI" HEIGHT="43" WIDTH="151"> 
<!--end header-->
<BR Clear>
<H1>hash_multimap&lt;Key, Data, HashFcn, EqualKey, Alloc&gt;</H1>

<Table CellPadding=0 CellSpacing=0 width=100%>
<TR>
<TD Align=left><Img src = "containers.gif" Alt=""   WIDTH = "194"  HEIGHT = "38" ></TD>
<TD Align=right><Img src = "type.gif" Alt=""   WIDTH = "194"  HEIGHT = "39" ></TD>
</TR>
<TR>
<TD Align=left VAlign=top><b>Category</b>: containers</TD>
<TD Align=right VAlign=top><b>Component type</b>: type</TD>
</TR>
</Table>

<h3>Description</h3>
<tt>Hash_multimap</tt> is a
<A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
that associates objects of type <tt>Key</tt> with
objects of type <tt>Data</tt>.  <tt>Hash_multimap</tt> is a 
<A href="PairAssociativeContainer.html">Pair Associative Container</A>,
meaning that its value type is
<tt><A href="pair.html">pair</A>&lt;const Key, Data&gt;</tt>.  It is also a 
<A href="MultipleAssociativeContainer.html">Multiple Associative Container</A>,
meaning that there is no limit on the number of
elements whose keys may compare equal using <tt>EqualKey</tt>.
<P>
Looking up an element in a <tt>hash_multimap</tt> by its key is
efficient, so <tt>hash_multimap</tt> is useful for
&quot;dictionaries&quot; where the order of elements is irrelevant.
If it is important for the elements to be in a particular order,
however, then <tt><A href="Multimap.html">multimap</A></tt> is more
appropriate.
<h3>Example</h3>
<pre>
struct eqstr
{
  bool operator()(const char* s1, const char* s2) const
  {
    return strcmp(s1, s2) == 0;
  }
};

typedef hash_multimap&lt;const char*, int, hash&lt;const char*&gt;, eqstr&gt; map_type;

void lookup(const map_type&amp; Map, const char* str)
{
  cout &lt;&lt; str &lt;&lt; &quot;: &quot;;
  pair&lt;map_type::const_iterator, map_type::const_iterator&gt; p =
    Map.equal_range(str);
  for (map_type::const_iterator i = p.first; i != p.second; ++i)
    cout &lt;&lt; (*i).second &lt;&lt; &quot; &quot;;
  cout &lt;&lt; endl;
}

int main()
{
  map_type M;
  M.insert(map_type::value_type(&quot;H&quot;, 1));
  M.insert(map_type::value_type(&quot;H&quot;, 2));
  M.insert(map_type::value_type(&quot;C&quot;, 12));
  M.insert(map_type::value_type(&quot;C&quot;, 13));
  M.insert(map_type::value_type(&quot;O&quot;, 16));
  M.insert(map_type::value_type(&quot;O&quot;, 17));
  M.insert(map_type::value_type(&quot;O&quot;, 18));
  M.insert(map_type::value_type(&quot;I&quot;, 127));

  lookup(M, &quot;I&quot;);
  lookup(M, &quot;O&quot;);
  lookup(M, &quot;Rn&quot;);
}
</pre>
<h3>Definition</h3>
Defined in the header <A href="hash_map">hash_map</A>, and in the backward-compatibility
header <A href="hash_map.h">hash_map.h</A>.  This class is an SGI extension; it is not part
of the C++ standard.
<h3>Template parameters</h3>
<Table border>
<TR>
<TH>
Parameter
</TH>
<TH>
Description
</TH>
<TH>
Default
</TH>
</TR>
<TR>
<TD VAlign=top>
<tt>Key</tt>
</TD>
<TD VAlign=top>
The hash_multimap's key type.  This is also defined as <tt>hash_multimap::key_type</tt>.
</TD>
<TD VAlign=top>
&nbsp;
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>Data</tt>
</TD>
<TD VAlign=top>
The hash_multimap's data type.  This is also defined as <tt>hash_multimap::data_type</tt>.
</TD>
<TD VAlign=top>
&nbsp;
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>HashFcn</tt>
</TD>
<TD VAlign=top>
The <A href="HashFunction.html">hash function</A> used by the hash_multimap.  This is also defined
   as <tt>hash_multimap::hasher</tt>.  
</TD>
<TD VAlign=top>
<tt><A href="hash.html">hash</A>&lt;Key&gt;</tt>
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>EqualKey</tt>
</TD>
<TD VAlign=top>
The hash_multimap's key equality function: a <A href="BinaryPredicate.html">binary predicate</A> that
   determines whether two keys are equal.  This is also defined as
   <tt>hash_multimap::key_equal</tt>.
</TD>
<TD VAlign=top>
<tt><A href="equal_to.html">equal_to</A>&lt;Key&gt;</tt>
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>Alloc</tt>
</TD>
<TD VAlign=top>
The <tt>hash_set</tt>'s allocator, used for all internal memory management.
</TD>
<TD VAlign=top>
<tt><A href="Allocators.html">alloc</A></tt>
</TD>
</tr>
</table>
<h3>Model of</h3>
<A href="MultipleHashedAssociativeContainer.html">Multiple Hashed Associative Container</A>,
<A href="PairAssociativeContainer.html">Pair Associative Container</A>
<h3>Type requirements</h3>
<UL>
<LI>
<tt>Key</tt> is <A href="Assignable.html">Assignable</A>.
<LI>
<tt>EqualKey</tt> is a <A href="BinaryPredicate.html">Binary Predicate</A> whose argument type
   is <tt>Key</tt>.
<LI>
<tt>EqualKey</tt> is an equivalence relation.
<LI>
<tt>Alloc</tt> is an <A href="Allocators.html">Allocator</A>.
</UL>
<h3>Public base classes</h3>
None.
<h3>Members</h3>
<Table border>
<TR>
<TH>
Member
</TH>
<TH>
Where defined
</TH>
<TH>
Description
</TH>
</TR>
<TR>
<TD VAlign=top>
<tt>key_type</tt>
</TD>
<TD VAlign=top>
 <A href="AssociativeContainer.html">Associative Container</A>
</TD>
<TD VAlign=top>
The <tt>hash_multimap</tt>'s key type, <tt>Key</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>data_type</tt>
</TD>
<TD VAlign=top>
 <A href="PairAssociativeContainer.html">Pair Associative Container</A>
</TD>
<TD VAlign=top>
The type of object associated with the keys.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>value_type</tt>
</TD>
<TD VAlign=top>
 <A href="PairAssociativeContainer.html">Pair Associative Container</A>
</TD>
<TD VAlign=top>
The type of object, <tt>pair&lt;const key_type, data_type&gt;</tt>, stored in the hash_multimap.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>hasher</tt>
</TD>
<TD VAlign=top>
 <A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
</TD>
<TD VAlign=top>
The <tt>hash_multimap</tt>'s <A href="HashFunction.html">hash function</A>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>key_equal</tt>
</TD>
<TD VAlign=top>
 <A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
</TD>
<TD VAlign=top>
 <A href="functors.html">Function object</A> that compares keys for equality.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>pointer</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Pointer to <tt>T</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>reference</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Reference to <tt>T</tt>
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>const_reference</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Const reference to <tt>T</tt>
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>size_type</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
An unsigned integral type.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>difference_type</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
A signed integral type.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>iterator</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Iterator used to iterate through a <tt>hash_multimap</tt>. <A href="#1">[1]</A>
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>const_iterator</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Const iterator used to iterate through a <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>iterator <b>begin</b>()</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Returns an <tt>iterator</tt> pointing to the beginning of the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>iterator <b>end</b>()</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Returns an <tt>iterator</tt> pointing to the end of the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>const_iterator <b>begin</b>() const</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Returns an <tt>const_iterator</tt> pointing to the beginning of the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>const_iterator <b>end</b>() const</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Returns an <tt>const_iterator</tt> pointing to the end of the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>size_type <b>size</b>() const</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Returns the size of the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>size_type <b>max_size</b>() const</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Returns the largest possible size of the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>bool <b>empty</b>() const</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
<tt>true</tt> if the <tt>hash_multimap</tt>'s size is <tt>0</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>size_type <b>bucket_count</b>() const</tt>
</TD>
<TD VAlign=top>
 <A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Returns the number of buckets used by the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>void <b>resize</b>(size_type n)</tt>
</TD>
<TD VAlign=top>
 <A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Increases the bucket count to at least <tt>n</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>hasher <b>hash_funct</b>() const</tt>
</TD>
<TD VAlign=top>
 <A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Returns the <tt>hasher</tt> object used by the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>key_equal <b>key_eq</b>() const</tt>
</TD>
<TD VAlign=top>
 <A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Returns the <tt>key_equal</tt> object used by the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<b><tt>hash_multimap</b>()</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Creates an empty <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<b><tt>hash_multimap</b>(size_type n)</tt>
</TD>
<TD VAlign=top>
 <A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Creates an empty <tt>hash_multimap</tt> with at least <tt>n</tt> buckets.
</TD>
</TR>
<TR>
<TD VAlign=top>
<pre>
<b>hash_multimap</b>(size_type n, 
              const hasher&amp; h)
</pre>
</TD>
<TD VAlign=top>
 <A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Creates an empty <tt>hash_multimap</tt> with at least <tt>n</tt> buckets, using <tt>h</tt>
   as the hash function.
</TD>
</TR>
<TR>
<TD VAlign=top>
<pre>
<b>hash_multimap</b>(size_type n, 
              const hasher&amp; h, 
              const key_equal&amp; k)
</pre>
</TD>
<TD VAlign=top>
 <A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Creates an empty <tt>hash_multimap</tt> with at least <tt>n</tt> buckets, using <tt>h</tt>
   as the hash function and <tt>k</tt> as the key equal function.
</TD>
</TR>
<TR>
<TD VAlign=top>
<pre>
template &lt;class <A href="InputIterator.html">InputIterator</A>&gt;
<b>hash_multimap</b>(InputIterator, InputIterator)
<A href="#2">[2]</A>
</pre>
</TD>
<TD VAlign=top>
 <A href="MultipleHashedAssociativeContainer.html">Multiple Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Creates a hash_multimap with a copy of a range.
</TD>
</TR>
<TR>
<TD VAlign=top>
<pre>
template &lt;class <A href="InputIterator.html">InputIterator</A>&gt;
<b>hash_multimap</b>(InputIterator, InputIterator,
              size_type n)
<A href="#2">[2]</A>
</pre>
</TD>
<TD VAlign=top>
 <A href="MultipleHashedAssociativeContainer.html">Multiple Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Creates a hash_multimap with a copy of a range and a bucket count of at
   least <tt>n</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<pre>
template &lt;class <A href="InputIterator.html">InputIterator</A>&gt;
<b>hash_multimap</b>(InputIterator, InputIterator,
              size_type n, const hasher&amp; h)
<A href="#2">[2]</A>
</pre>
</TD>
<TD VAlign=top>
 <A href="MultipleHashedAssociativeContainer.html">Multiple Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Creates a hash_multimap with a copy of a range and a bucket count of at
   least <tt>n</tt>, using <tt>h</tt> as the hash function.
</TD>
</TR>
<TR>
<TD VAlign=top>
<pre>
template &lt;class <A href="InputIterator.html">InputIterator</A>&gt;
<b>hash_multimap</b>(InputIterator, InputIterator,
              size_type n, const hasher&amp; h, 
              const key_equal&amp; k)
<A href="#2">[2]</A>
</pre>
</TD>
<TD VAlign=top>
 <A href="MultipleHashedAssociativeContainer.html">Multiple Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Creates a hash_multimap with a copy of a range and a bucket count of at
   least <tt>n</tt>, using <tt>h</tt> as the hash function and <tt>k</tt> as the
   key equal function.
</TD>
</TR>
<TR>
<TD VAlign=top>
<b><tt>hash_multimap</b>(const hash_multimap&amp;)</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
The copy constructor.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>hash_multimap&amp; <b>operator=</b>(const hash_multimap&amp;)</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
The assignment operator
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>void <b>swap</b>(hash_multimap&amp;)</tt>
</TD>
<TD VAlign=top>
 <A href="Container.html">Container</A>
</TD>
<TD VAlign=top>
Swaps the contents of two hash_multimaps.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>iterator <b>insert</b>(const value_type&amp; x)</tt>
</TD>
<TD VAlign=top>
 <A href="MultipleAssociativeContainer.html">Multiple Associative Container</A>
</TD>
<TD VAlign=top>
Inserts <tt>x</tt> into the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<pre>
template &lt;class <A href="InputIterator.html">InputIterator</A>&gt;
void <b>insert</b>(InputIterator, InputIterator)
<A href="#2">[2]</A>
</pre>
</TD>
<TD VAlign=top>
 <A href="MultipleAssociativeContainer.html">Multiple Associative Container</A>
</TD>
<TD VAlign=top>
Inserts a range into the <tt>hash_multimap</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>void <b>erase</b>(iterator pos)</tt>
</TD>
<TD VAlign=top>
 <A href="AssociativeContainer.html">Associative Container</A>
</TD>
<TD VAlign=top>
Erases the element pointed to by <tt>pos</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>size_type <b>erase</b>(const key_type&amp; k)</tt>
</TD>
<TD VAlign=top>
 <A href="AssociativeContainer.html">Associative Container</A>
</TD>
<TD VAlign=top>
Erases the element whose key is <tt>k</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>void <b>erase</b>(iterator first, iterator last)</tt>
</TD>
<TD VAlign=top>
 <A href="AssociativeContainer.html">Associative Container</A>
</TD>
<TD VAlign=top>
Erases all elements in a range.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>void <b>clear</b>()</tt>
</TD>
<TD VAlign=top>
 <A href="AssociativeContainer.html">Associative Container</A>
</TD>
<TD VAlign=top>
Erases all of the elements.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>const_iterator <b>find</b>(const key_type&amp; k) const</tt>
</TD>
<TD VAlign=top>
 <A href="AssociativeContainer.html">Associative Container</A>
</TD>
<TD VAlign=top>
Finds an element whose key is <tt>k</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>iterator <b>find</b>(const key_type&amp; k)</tt>
</TD>
<TD VAlign=top>
 <A href="AssociativeContainer.html">Associative Container</A>
</TD>
<TD VAlign=top>
Finds an element whose key is <tt>k</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<tt>size_type <b>count</b>(const key_type&amp; k) const</tt>
</TD>
<TD VAlign=top>
 <A href="AssociativeContainer.html">Associative Container</A>
</TD>
<TD VAlign=top>
Counts the number of elements whose key is <tt>k</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<pre>
pair&lt;const_iterator, const_iterator&gt; 
<b>equal_range</b>(const key_type&amp; k) const
</pre>
</TD>
<TD VAlign=top>
 <A href="AssociativeContainer.html">Associative Container</A>
</TD>
<TD VAlign=top>
Finds a range containing all elements whose key is <tt>k</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<pre>
pair&lt;iterator, iterator&gt; 
<b>equal_range</b>(const key_type&amp; k)
</pre>
</TD>
<TD VAlign=top>
 <A href="AssociativeContainer.html">Associative Container</A>
</TD>
<TD VAlign=top>
Finds a range containing all elements whose key is <tt>k</tt>.
</TD>
</TR>
<TR>
<TD VAlign=top>
<pre>
bool <b>operator==</b>(const hash_multimap&amp;, 
                const hash_multimap&amp;)
</pre>
</TD>
<TD VAlign=top>
 <A href="HashedAssociativeContainer.html">Hashed Associative Container</A>
</TD>
<TD VAlign=top>
Tests two hash_multimaps for equality.   This is a global function,
   not a member function.
</TD>
</tr>
</table>
<h3>New members</h3>
All of <tt>hash_multimap</tt>'s members are defined in the 
<A href="MultipleHashedAssociativeContainer.html">Multiple Hashed Associative Container</A> and 
<A href="PairAssociativeContainer.html">Pair Associative Container</A>
requirements.  <tt>Hash_multimap</tt> does not introduce any new
members.
<h3>Notes</h3>
<P><A name="1">[1]</A>
<tt>Hash_multimap::iterator</tt> is not a mutable iterator, because
<tt>hash_multimap::value_type</tt> is not
<A href="Assignable.html">Assignable</A>.  That is, if <tt>i</tt> is of
type <tt>hash_multimap::iterator</tt> and <tt>p</tt> is of type
<tt>hash_multimap::value_type</tt>, then <tt>*i = p</tt> is not a
valid expression.  However, <tt>hash_multimap::iterator</tt> isn't a
constant iterator either, because it can be used to modify the object
that it points to.  Using the same notation as above,
<tt>(*i).second = p</tt> is a valid expression.
<P><A name="2">[2]</A>
This member function relies on <i>member template</i> functions, which
at present (early 1998) are not supported by all compilers.  If your
compiler supports member templates, you can call this function with
any type of <A href="InputIterator.html">input iterator</A>.  If your
compiler does not yet support member templates, though, then the
arguments must either be of type <tt>const value_type*</tt> or of type
<tt>hash_multimap::const_iterator</tt>.
<h3>See also</h3>
<A href="AssociativeContainer.html">Associative Container</A>,
<A href="HashedAssociativeContainer.html">Hashed Associative Container</A>, 
<A href="PairAssociativeContainer.html">Pair Associative Container</A>,
<A href="MultipleHashedAssociativeContainer.html">Multiple Hashed Associative Container</A>, 
<tt><A href="set.html">set</A></tt>,
<tt><A href="Map.html">map</A></tt>,
<tt><A href="multiset.html">multiset</A></tt>,
<tt><A href="Multimap.html">multimap</A></tt>,
<tt><A href="hash_set.html">hash_set</A></tt>,
 <tt><A href="hash_map.html">hash_map</A></tt>,
<tt><A href="hash_multiset.html">hash_multiset</A></tt>

<!--start footer--> 
<HR SIZE="6">
<A href="http://www.sgi.com/"><IMG SRC="surf.gif" HEIGHT="54" WIDTH="54" 
        ALT="[Silicon Surf]"></A>
<A HREF="index.html"><IMG SRC="stl_home.gif" 
        HEIGHT="54" WIDTH="54" ALT="[STL Home]"></A>
<BR>
<FONT SIZE="-2">
<A href="http://www.sgi.com/Misc/sgi_info.html" TARGET="_top">Copyright &copy; 
1999 Silicon Graphics, Inc.</A> All Rights Reserved.</FONT>
<FONT SIZE="-3"><a href="http://www.sgi.com/Misc/external.list.html" TARGET="_top">TrademarkInformation</A>
</FONT>
<P>
</BODY>
</HTML>