Imported Upstream version 1.57.0
[platform/upstream/boost.git] / doc / html / hash / disable.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Disabling The Extensions</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.html" title="Chapter&#160;12.&#160;Boost.Functional/Hash">
9 <link rel="prev" href="portability.html" title="Portability">
10 <link rel="next" href="changes.html" title="Change Log">
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="portability.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="changes.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="hash.disable"></a><a class="link" href="disable.html" title="Disabling The Extensions">Disabling The Extensions</a>
28 </h2></div></div></div>
29 <p>
30       While <code class="computeroutput"><a class="link" href="../boost/hash.html" title="Struct template hash">boost::hash</a></code>'s extensions are
31       generally useful, you might want to turn them of in order to check that your
32       code will work with other implementations of TR1. To do this define the macro
33       <code class="computeroutput"><span class="identifier">BOOST_HASH_NO_EXTENSIONS</span></code>. When
34       this macro is defined, only the specialisations detailed in TR1 will be declared.
35       But, if you later undefine the macro and include &lt;<code class="computeroutput"><a class="link" href="reference.html#header.boost.functional.hash_hpp" title="Header &lt;boost/functional/hash.hpp&gt;">boost/functional/hash.hpp</a></code>&gt;
36       then the non-specialised form will be defined - activating the extensions.
37     </p>
38 <p>
39       It is strongly recommended that you never undefine the macro - and only define
40       it so that it applies to the complete translation unit, either by defining
41       it at the beginning of the main source file or, preferably, by using a compiler
42       switch or preference. And you really should never define it in header files.
43     </p>
44 <p>
45       If you are writing a library which has code in the header which requires the
46       extensions, then the best action is to tell users not to define the macro.
47       Their code won't <span class="emphasis"><em>require</em></span> the macro.
48     </p>
49 <p>
50       Translation units that are compiled with the macro defined will link with units
51       that were compiled without it. This feature has been designed to avoid ODR
52       violations.
53     </p>
54 </div>
55 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
56 <td align="left"></td>
57 <td align="right"><div class="copyright-footer">Copyright &#169; 2005-2008 Daniel
58       James<p>
59         Distributed under the Boost Software License, Version 1.0. (See accompanying
60         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>)
61       </p>
62 </div></td>
63 </tr></table>
64 <hr>
65 <div class="spirit-nav">
66 <a accesskey="p" href="portability.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="changes.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
67 </div>
68 </body>
69 </html>