blob: 1d9f3d67f6717557eaf1ac34f50bd05fe18bdada (
plain)
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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Chapter 10. Boost.ContainerHash</title>
<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="libraries.html" title="Part I. The Boost C++ Libraries (BoostBook Subset)">
<link rel="prev" href="container/release_notes.html" title="Release Notes">
<link rel="next" href="hash/tutorial.html" title="Tutorial">
</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="container/release_notes.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.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="hash/tutorial.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="chapter">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="hash"></a>Chapter 10. Boost.ContainerHash</h2></div>
<div><div class="author"><h3 class="author">
<span class="firstname">Daniel</span> <span class="surname">James</span>
</h3></div></div>
<div><p class="copyright">Copyright © 2005-2008 Daniel
James</p></div>
<div><div class="legalnotice">
<a name="hash.legal"></a><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></div>
</div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="section"><a href="hash.html#hash.intro">Introduction</a></span></dt>
<dt><span class="section"><a href="hash/tutorial.html">Tutorial</a></span></dt>
<dt><span class="section"><a href="hash/custom.html">Extending boost::hash for a custom data type</a></span></dt>
<dt><span class="section"><a href="hash/combine.html">Combining hash values</a></span></dt>
<dt><span class="section"><a href="hash/portability.html">Portability</a></span></dt>
<dt><span class="section"><a href="hash/disable.html">Disabling The Extensions</a></span></dt>
<dt><span class="section"><a href="hash/changes.html">Change Log</a></span></dt>
<dt><span class="section"><a href="hash/rationale.html">Rationale</a></span></dt>
<dt><span class="section"><a href="hash/reference.html">Reference</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="hash/reference.html#hash.reference.specification"></a></span></dt>
<dt><span class="section"><a href="hash/reference.html#header.boost.container_hash.hash_hpp">Header <boost/container_hash/hash.hpp></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="hash/links.html">Links</a></span></dt>
<dt><span class="section"><a href="hash/acknowledgements.html">Acknowledgements</a></span></dt>
</dl>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="hash.intro"></a><a class="link" href="hash.html#hash.intro" title="Introduction">Introduction</a>
</h2></div></div></div>
<p>
<code class="computeroutput"><a class="link" href="boost/hash.html" title="Struct template hash">boost::hash</a></code> is an implementation of
the <a href="http://en.wikipedia.org/wiki/Hash_function" target="_top">hash function</a>
object specified by the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">Draft
Technical Report on C++ Library Extensions</a> (TR1). It is the default
hash function for <a class="link" href="unordered.html" title="Chapter 44. Boost.Unordered">Boost.Unordered</a>, <a class="link" href="intrusive/unordered_set_unordered_multiset.html" title="Semi-Intrusive unordered associative containers: unordered_set, unordered_multiset">Boost.Intrusive</a>'s
unordered associative containers, and <a href="../../libs/multi_index/doc/index.html" target="_top">Boost.MultiIndex</a>'s
hash indicies and <a href="../../libs/bimap/index.html" target="_top">Boost.Bimap</a>'s
<code class="computeroutput"><span class="identifier">unordered_set_of</span></code>.
</p>
<p>
As it is compliant with <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">TR1</a>,
it will work with:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
integers
</li>
<li class="listitem">
floats
</li>
<li class="listitem">
pointers
</li>
<li class="listitem">
strings
</li>
</ul></div>
<p>
It also implements the extension proposed by Peter Dimov in 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), this adds support
for:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
arrays
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code>
</li>
<li class="listitem">
the standard containers.
</li>
<li class="listitem">
extending <code class="computeroutput"><a class="link" href="boost/hash.html" title="Struct template hash">boost::hash</a></code> for custom
types.
</li>
</ul></div>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>
This hash function is designed to be used in containers based on the STL
and is not suitable as a general purpose hash function. For more details
see the <a class="link" href="hash/rationale.html" title="Rationale">rationale</a>.
</p></td></tr>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: August 14, 2019 at 12:10:14 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="container/release_notes.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="libraries.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="hash/tutorial.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
|