Imported Upstream version 1.57.0
[platform/upstream/boost.git] / doc / html / boost / hash.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Struct template hash</title>
5 <link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8 <link rel="up" href="../hash/reference.html#header.boost.functional.hash_hpp" title="Header &lt;boost/functional/hash.hpp&gt;">
9 <link rel="prev" href="../hash/reference.html" title="Reference">
10 <link rel="next" href="hash_bool_idp40945552.html" title="Struct hash&lt;bool&gt;">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
15 <td align="center"><a href="../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="../hash/reference.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../hash/reference.html#header.boost.functional.hash_hpp"><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_bool_idp40945552.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="refentry">
26 <a name="boost.hash"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Struct template hash</span></h2>
29 <p>boost::hash &#8212; A <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">TR1</a> compliant hash function object.</p>
30 </div>
31 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
32 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../hash/reference.html#header.boost.functional.hash_hpp" title="Header &lt;boost/functional/hash.hpp&gt;">boost/functional/hash.hpp</a>&gt;
33
34 </span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> 
35 <span class="keyword">struct</span> <a class="link" href="hash.html" title="Struct template hash">hash</a> <span class="special">:</span> <span class="keyword">public</span> std::unary_function&lt;T, std::size_t&gt; <span class="special">{</span>
36   <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="hash.html#idp111194224-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
37 <span class="special">}</span><span class="special">;</span></pre></div>
38 <div class="refsect1">
39 <a name="idp212396688"></a><h2>Description</h2>
40 <pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="idp111194224-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span><span class="special">&amp;</span> val<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
41 <div class="variablelist"><table border="0" class="variablelist compact">
42 <colgroup>
43 <col align="left" valign="top">
44 <col>
45 </colgroup>
46 <tbody>
47 <tr>
48 <td><p><span class="term">Returns:</span></p></td>
49 <td>
50 <p>
51             </p>
52 <pre class="programlisting"><a class="link" href="../hash/reference.html#boost.hash_value_idp45575600">hash_value</a><span class="special">(</span><span class="identifier">val</span><span class="special">)</span></pre>
53 <p>
54           </p>
55 </td>
56 </tr>
57 <tr>
58 <td><p><span class="term">Notes:</span></p></td>
59 <td>
60 <p>
61               The call to <code class="computeroutput"><a class="link" href="../hash/reference.html#boost.hash_value_idp45575600">hash_value</a></code>
62               is unqualified, so that custom overloads can be
63               found via argument dependent lookup.
64             </p>
65 <p>
66               This is not defined when the macro <code class="computeroutput">BOOST_HASH_NO_EXTENSIONS</code>
67               is defined. The specializations are still defined, so only the specializations
68               required by TR1 are defined.
69             </p>
70 <p>
71               Forward declared in
72               <code class="computeroutput">&lt;boost/functional/hash_fwd.hpp&gt;</code>
73             </p>
74 <p>
75               This hash function is not intended for general use, and isn't
76               guaranteed to be equal during separate runs of a program - so
77               please don't use it for any persistent storage or communication.
78             </p>
79 </td>
80 </tr>
81 <tr>
82 <td><p><span class="term">Throws:</span></p></td>
83 <td><p>
84             Only throws if
85             <code class="computeroutput"><a class="link" href="../hash/reference.html#boost.hash_value_idp45575600">hash_value</a>(T)</code> throws.
86           </p></td>
87 </tr>
88 </tbody>
89 </table></div>
90 </div>
91 </div>
92 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
93 <td align="left"></td>
94 <td align="right"><div class="copyright-footer">Copyright &#169; 2005-2008 Daniel
95       James<p>
96         Distributed under the Boost Software License, Version 1.0. (See accompanying
97         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>)
98       </p>
99 </div></td>
100 </tr></table>
101 <hr>
102 <div class="spirit-nav">
103 <a accesskey="p" href="../hash/reference.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../hash/reference.html#header.boost.functional.hash_hpp"><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_bool_idp40945552.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
104 </div>
105 </body>
106 </html>