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
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Reference</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../hash.html" title="Chapter 12. Boost.Functional/Hash">
<link rel="prev" href="rationale.html" title="Rationale">
<link rel="next" href="../boost/hash.html" title="Struct template hash">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rationale.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../hash.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../boost/hash.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="hash.reference"></a>Reference</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="reference.html#hash.reference.specification"></a></span></dt>
<dt><span class="section"><a href="reference.html#header.boost.functional.hash_hpp">Header <boost/functional/hash.hpp></a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"></div>
<p>For the full specification, see section 6.3 of the
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">C++ Standard Library Technical Report</a>
and issue 6.18 of the
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1837.pdf" target="_top">Library Extension Technical Report Issues List</a> (page 63).
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="header.boost.functional.hash_hpp"></a>Header <<a href="../../../boost/functional/hash.hpp" target="_top">boost/functional/hash.hpp</a>></h3></div></div></div>
<p>
Defines <code class="computeroutput"><a class="link" href="../boost/hash.html" title="Struct template hash">boost::hash</a></code>,
and helper functions.
</p>
<pre class="synopsis"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash.html" title="Struct template hash">hash</a><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_bool_idp40945552.html" title="Struct hash<bool>">hash</a><span class="special"><</span><span class="keyword">bool</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_char_idp47308912.html" title="Struct hash<char>">hash</a><span class="special"><</span><span class="keyword">char</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_signed_c_idp107103920.html" title="Struct hash<signed char>">hash</a><span class="special"><</span><span class="keyword">signed</span> <span class="keyword">char</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_unsigned__idp40289168.html" title="Struct hash<unsigned char>">hash</a><span class="special"><</span><span class="keyword">unsigned</span> <span class="keyword">char</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_wchar_t_idp100085152.html" title="Struct hash<wchar_t>">hash</a><span class="special"><</span><span class="keyword">wchar_t</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_short_idp113232624.html" title="Struct hash<short>">hash</a><span class="special"><</span><span class="keyword">short</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_unsigned__idp94408624.html" title="Struct hash<unsigned short>">hash</a><span class="special"><</span><span class="keyword">unsigned</span> <span class="keyword">short</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_int_idp38064256.html" title="Struct hash<int>">hash</a><span class="special"><</span><span class="keyword">int</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_unsigned__idp48534896.html" title="Struct hash<unsigned int>">hash</a><span class="special"><</span><span class="keyword">unsigned</span> <span class="keyword">int</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_long_idp100971824.html" title="Struct hash<long>">hash</a><span class="special"><</span><span class="keyword">long</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_unsigned__idp44420688.html" title="Struct hash<unsigned long>">hash</a><span class="special"><</span><span class="keyword">unsigned</span> <span class="keyword">long</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_long_lon_idp101636672.html" title="Struct hash<long long>">hash</a><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_unsigned__idp71328176.html" title="Struct hash<unsigned long long>">hash</a><span class="special"><</span><span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="keyword">long</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_float_idp101633168.html" title="Struct hash<float>">hash</a><span class="special"><</span><span class="keyword">float</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_double_idp37787440.html" title="Struct hash<double>">hash</a><span class="special"><</span><span class="keyword">double</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_long_doub_idp40704560.html" title="Struct hash<long double>">hash</a><span class="special"><</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_std_stri_idp110974848.html" title="Struct hash<std::string>">hash</a><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_std_wstri_idp46340064.html" title="Struct hash<std::wstring>">hash</a><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">wstring</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_T_idp111201264.html" title="Struct template hash<T*>">hash</a><span class="special"><</span><span class="identifier">T</span><span class="special">*</span><span class="special">></span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="../boost/hash_std_type__idp47603776.html" title="Struct hash<std::type_index>">hash</a><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">type_index</span><span class="special">></span><span class="special">;</span>
<span class="comment">// <a class="link" href="reference.html#idp105637376-bb">Support functions (Boost extension).</a></span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">></span> <span class="keyword">void</span> <a class="link" href="reference.html#boost.hash_combine"><span class="identifier">hash_combine</span></a><span class="special">(</span><span class="identifier">size_t</span> <span class="special">&</span><span class="special">,</span> <span class="identifier">T</span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> It<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp49204992-bb"><span class="identifier">hash_range</span></a><span class="special">(</span><span class="identifier">It</span><span class="special">,</span> <span class="identifier">It</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> It<span class="special">></span> <span class="keyword">void</span> <a class="link" href="reference.html#idp113433904-bb"><span class="identifier">hash_range</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&</span><span class="special">,</span> <span class="identifier">It</span><span class="special">,</span> <span class="identifier">It</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// <a class="link" href="reference.html#idp45574784-bb">Overloadable hash implementation (Boost extension).</a></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp54500624-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">bool</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp54502368-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">char</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp76377568-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">signed</span> <span class="keyword">char</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp76379312-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">char</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp106951664-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">wchar_t</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp106953408-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">short</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp45628288-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">short</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp45630032-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp69078176-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp69079920-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">long</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp105511920-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">long</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp105513664-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp100999280-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="keyword">long</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp101001024-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">float</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp41306672-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">double</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp41308416-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp55446864-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">unsigned</span> N<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp55449296-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">T</span> <span class="special">(</span><span class="special">&</span><span class="identifier">val</span><span class="special">)</span><span class="special">[</span><span class="identifier">N</span><span class="special">]</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">unsigned</span> N<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp96676912-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="special">(</span><span class="special">&</span><span class="identifier">val</span><span class="special">)</span><span class="special">[</span><span class="identifier">N</span><span class="special">]</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Ch<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp102539312-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">Ch</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">Ch</span><span class="special">></span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> B<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp50883840-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> <span class="identifier">B</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp69660432-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp76221008-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp110857472-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">deque</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> K<span class="special">,</span> <span class="keyword">typename</span> C<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp100168224-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">C</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> K<span class="special">,</span> <span class="keyword">typename</span> C<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp50842096-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">multiset</span><span class="special"><</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">C</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> K<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> C<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp69145248-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">C</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> K<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> C<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp102727104-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">multimap</span><span class="special"><</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">C</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp110658352-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp110661104-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">type_index</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> N<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp47766112-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">array</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">N</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span><span class="special">...</span> T<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="reference.html#idp113415936-bb"><span class="identifier">hash_value</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special"><</span><span class="identifier">T</span><span class="special">...</span><span class="special">></span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span></pre>
<div class="refsect2">
<a name="idp211880144"></a><h3>
<a name="idp105637376-bb"></a><code class="computeroutput"></code> Support functions (Boost extension).</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">></span> <span class="keyword">void</span> <a name="boost.hash_combine"></a><span class="identifier">hash_combine</span><span class="special">(</span><span class="identifier">size_t</span> <span class="special">&</span> seed<span class="special">,</span> <span class="identifier">T</span> <span class="keyword">const</span><span class="special">&</span> v<span class="special">)</span><span class="special">;</span></pre>
<p class="simpara">
Called repeatedly to incrementally create a hash value from
several variables.
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td>
Updates <code class="computeroutput">seed</code> with a new hash value generated by
combining it with the result of
<code class="computeroutput"><a class="link" href="reference.html#boost.hash_value_idp45575600">hash_value</a>(v)</code>. Will
always produce the same result for the same combination of
<code class="computeroutput">seed</code> and
<code class="computeroutput"><a class="link" href="reference.html#boost.hash_value_idp45575600">hash_value</a>(v)</code> during
the single run of a program.
</td>
</tr>
<tr>
<td><p><span class="term">Notes:</span></p></td>
<td>
<p><a class="link" href="reference.html#boost.hash_value_idp45575600">hash_value</a> is called without
qualification, so that overloads can be found via ADL.</p>
<p>This is an extension to TR1</p>
<p>
Forward declared in
<code class="computeroutput"><boost/functional/hash_fwd.hpp></code>
</p>
<p>
This hash function is not intended for general use, and isn't
guaranteed to be equal during separate runs of a program - so
please don't use it for any persistent storage or communication.
</p>
</td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>
Only throws if <a class="link" href="reference.html#boost.hash_value_idp45575600">hash_value</a>(T) throws.
Strong exception safety, as long as <a class="link" href="reference.html#boost.hash_value_idp45575600">hash_value</a>(T)
also has strong exception safety.
</td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<p><a name="boost.hash_range"></a></p>
<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> It<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp49204992-bb"></a><span class="identifier">hash_range</span><span class="special">(</span><span class="identifier">It</span> first<span class="special">,</span> <span class="identifier">It</span> last<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> It<span class="special">></span> <span class="keyword">void</span> <a name="idp113433904-bb"></a><span class="identifier">hash_range</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">&</span> seed<span class="special">,</span> <span class="identifier">It</span> first<span class="special">,</span> <span class="identifier">It</span> last<span class="special">)</span><span class="special">;</span></pre>
<p class="simpara">
Calculate the combined hash value of the elements of an iterator
range.
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td>
<p>For the two argument overload:
</p>
<pre class="programlisting">
<span class="identifier">size_t</span> <span class="identifier">seed</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
<span class="keyword">for</span><span class="special">(</span><span class="special">;</span> <span class="identifier">first</span> <span class="special">!=</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">first</span><span class="special">)</span>
<span class="special">{</span>
<a class="link" href="reference.html#boost.hash_combine">hash_combine</a><span class="special">(</span><span class="identifier">seed</span><span class="special">,</span> <span class="special">*</span><span class="identifier">first</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span>
<span class="keyword">return</span> <span class="identifier">seed</span><span class="special">;</span>
</pre>
<p>
</p>
<p>For the three arguments overload:</p>
<pre class="programlisting">
<span class="keyword">for</span><span class="special">(</span><span class="special">;</span> <span class="identifier">first</span> <span class="special">!=</span> <span class="identifier">last</span><span class="special">;</span> <span class="special">++</span><span class="identifier">first</span><span class="special">)</span>
<span class="special">{</span>
<a class="link" href="reference.html#boost.hash_combine">hash_combine</a><span class="special">(</span><span class="identifier">seed</span><span class="special">,</span> <span class="special">*</span><span class="identifier">first</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span>
</pre>
</td>
</tr>
<tr>
<td><p><span class="term">Notes:</span></p></td>
<td>
<p>
<code class="computeroutput">hash_range</code> is sensitive to the order of the elements
so it wouldn't be appropriate to use this with an unordered
container.
</p>
<p>This is an extension to TR1</p>
<p>
Forward declared in
<code class="computeroutput"><boost/functional/hash_fwd.hpp></code>
</p>
<p>
This hash function is not intended for general use, and isn't
guaranteed to be equal during separate runs of a program - so
please don't use it for any persistent storage or communication.
</p>
</td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td><p>
Only throws if <code class="computeroutput"><a class="link" href="reference.html#boost.hash_value_idp45575600">hash_value</a>(std::iterator_traits<It>::value_type)</code>
throws. <code class="computeroutput">hash_range(std::size_t&, It, It)</code> has basic exception safety as long as
<code class="computeroutput"><a class="link" href="reference.html#boost.hash_value_idp45575600">hash_value</a>(std::iterator_traits<It>::value_type)</code>
has basic exception safety.
</p></td>
</tr>
</tbody>
</table></div>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp211967120"></a><h3>
<a name="idp45574784-bb"></a><code class="computeroutput"></code> Overloadable hash implementation (Boost extension).</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<p><a name="boost.hash_value_idp45575600"></a></p>
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp54500624-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">bool</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp54502368-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">char</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp76377568-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">signed</span> <span class="keyword">char</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp76379312-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">char</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp106951664-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">wchar_t</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp106953408-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">short</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp45628288-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">short</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp45630032-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">int</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp69078176-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">int</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp69079920-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">long</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp105511920-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">long</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp105513664-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">long</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp100999280-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="keyword">long</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp101001024-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">float</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp41306672-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">double</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp41308416-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">double</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp55446864-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">unsigned</span> N<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp55449296-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">T</span> <span class="special">(</span><span class="special">&</span><span class="identifier">val</span><span class="special">)</span><span class="special">[</span><span class="identifier">N</span><span class="special">]</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">unsigned</span> N<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp96676912-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span> <span class="special">(</span><span class="special">&</span><span class="identifier">val</span><span class="special">)</span><span class="special">[</span><span class="identifier">N</span><span class="special">]</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> Ch<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp102539312-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">Ch</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">Ch</span><span class="special">></span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> A<span class="special">,</span> <span class="keyword">typename</span> B<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp50883840-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> <span class="identifier">B</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp69660432-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp76221008-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp110857472-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">deque</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> K<span class="special">,</span> <span class="keyword">typename</span> C<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp100168224-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">set</span><span class="special"><</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">C</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> K<span class="special">,</span> <span class="keyword">typename</span> C<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp50842096-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">multiset</span><span class="special"><</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">C</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> K<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> C<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp69145248-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">map</span><span class="special"><</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">C</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> K<span class="special">,</span> <span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> C<span class="special">,</span> <span class="keyword">typename</span> A<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp102727104-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">multimap</span><span class="special"><</span><span class="identifier">K</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">C</span><span class="special">,</span> <span class="identifier">A</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp110658352-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp110661104-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">type_index</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> N<span class="special">></span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp47766112-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">array</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">N</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> val<span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span><span class="special">...</span> T<span class="special">></span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp113415936-bb"></a><span class="identifier">hash_value</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special"><</span><span class="identifier">T</span><span class="special">...</span><span class="special">></span> val<span class="special">)</span><span class="special">;</span></pre>
<p class="simpara">
Implementation of the hash function.
</p>
<p>
Generally shouldn't be called directly by users, instead they should use
<code class="computeroutput"><a class="link" href="../boost/hash.html" title="Struct template hash">boost::hash</a></code>, <code class="computeroutput"><a class="link" href="reference.html#boost.hash_range">boost::hash_range</a></code>
or <code class="computeroutput"><a class="link" href="reference.html#boost.hash_combine">boost::hash_combine</a></code> which
call <code class="computeroutput">hash_value</code> without namespace qualification so that overloads
for custom types are found via ADL.
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Notes:</span></p></td>
<td>
<p>This is an extension to TR1</p>
<p>
This hash function is not intended for general use, and isn't
guaranteed to be equal during separate runs of a program - so
please don't use it for any persistent storage or communication.
</p>
</td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td>
Only throws if a user supplied version of
<code class="computeroutput"><a class="link" href="reference.html#boost.hash_value_idp45575600">hash_value</a></code>
throws for an element of a container, or
one of the types stored in a pair.
</td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>Types</th>
<th>Returns</th>
</tr></thead>
<tbody>
<tr>
<td>
<code class="computeroutput">bool</code>,
<code class="computeroutput">char</code>, <code class="computeroutput">signed char</code>, <code class="computeroutput">unsigned char</code>, <code class="computeroutput">wchar_t</code>,
<code class="computeroutput">short</code>, <code class="computeroutput">unsigned short</code>,
<code class="computeroutput">int</code>, <code class="computeroutput">unsigned int</code>, <code class="computeroutput">long</code>, <code class="computeroutput">unsigned long</code>
</td>
<td><code class="computeroutput">val</code></td>
</tr>
<tr>
<td>
<code class="computeroutput">long long</code>, <code class="computeroutput">unsigned long long</code>
</td>
<td>
<code class="computeroutput">val</code> when <code class="computeroutput">abs(val) <= std::numeric_limits<std::size_t>::max()</code>.</td>
</tr>
<tr>
<td>
<code class="computeroutput">float</code>, <code class="computeroutput">double</code>, <code class="computeroutput">long double</code>
</td>
<td>An unspecified value, except that equal arguments shall yield the same result.</td>
</tr>
<tr>
<td><code class="computeroutput">T*</code></td>
<td>An unspecified value, except that equal arguments shall yield the same result.</td>
</tr>
<tr>
<td>
<code class="computeroutput">T val[N]</code>,
<code class="computeroutput">const T val[N]</code>
</td>
<td><code class="computeroutput">hash_range(val, val+N)</code></td>
</tr>
<tr>
<td>
<code class="computeroutput">std:basic_string<Ch, std::char_traits<Ch>, A></code>,
<code class="computeroutput">std::vector<T, A></code>,
<code class="computeroutput">std::list<T, A></code>,
<code class="computeroutput">std::deque<T, A></code>,
<code class="computeroutput">std::set<K, C, A></code>,
<code class="computeroutput">std::multiset<K, C, A></code>,
<code class="computeroutput">std::map<K, T, C, A></code>,
<code class="computeroutput">std::multimap<K, T, C, A></code>,
<code class="computeroutput">std::array<T, N></code>
</td>
<td><code class="computeroutput">hash_range(val.begin(), val.end())</code></td>
</tr>
<tr>
<td><code class="computeroutput">std::pair<A, B></code></td>
<td><pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">size_t</span> <span class="identifier">seed</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
<a class="link" href="reference.html#boost.hash_combine">hash_combine</a><span class="special">(</span><span class="identifier">seed</span><span class="special">,</span> <span class="identifier">val</span><span class="special">.</span><span class="identifier">first</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="reference.html#boost.hash_combine">hash_combine</a><span class="special">(</span><span class="identifier">seed</span><span class="special">,</span> <span class="identifier">val</span><span class="special">.</span><span class="identifier">second</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">return</span> <span class="identifier">seed</span><span class="special">;</span></pre></td>
</tr>
<tr>
<td><code class="computeroutput">std::tuple<T...></code></td>
<td><pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">size_t</span> <span class="identifier">seed</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
<a class="link" href="reference.html#boost.hash_combine">hash_combine</a><span class="special">(</span><span class="identifier">seed</span><span class="special">,</span> <span class="identifier">get</span><span class="special"><</span><span class="number">0</span><span class="special">></span><span class="special">(</span><span class="identifier">val</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
<a class="link" href="reference.html#boost.hash_combine">hash_combine</a><span class="special">(</span><span class="identifier">seed</span><span class="special">,</span> <span class="identifier">get</span><span class="special"><</span><span class="number">1</span><span class="special">></span><span class="special">(</span><span class="identifier">val</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
<span class="comment">// ....</span>
<span class="keyword">return</span> <span class="identifier">seed</span><span class="special">;</span></pre></td>
</tr>
<tr>
<td>
<code class="computeroutput">std::complex<T></code>
</td>
<td>When <code class="computeroutput">T</code> is a built in type and <code class="computeroutput">val.imag() == 0</code>, the result is equal to <code class="computeroutput">hash_value(val.real())</code>. Otherwise an unspecified value, except that equal arguments shall yield the same result.</td>
</tr>
<tr>
<td>
<code class="computeroutput">std::type_index</code>
</td>
<td><code class="computeroutput">val.hash_code()</code></td>
</tr>
</tbody>
</table></div></td>
</tr>
</tbody>
</table></div>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2005-2008 Daniel
James<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rationale.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../hash.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../boost/hash.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
|