Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/doc/html/hash/disable.html @ 46

Last change on this file since 46 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 3.8 KB
Line 
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
4<title> Disabling The Extensions</title>
5<link rel="stylesheet" href="../boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
7<link rel="start" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8<link rel="up" href="../hash.html" title="Chapter 7. 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%">
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
15<td align="center"><a href="../../../index.htm">Home</a></td>
16<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="../../../people/people.htm">People</a></td>
18<td align="center"><a href="../../../more/faq.htm">FAQ</a></td>
19<td align="center"><a href="../../../more/index.htm">More</a></td>
20</table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="portability.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../hash.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="changes.html"><img src="../images/next.png" alt="Next"></a>
24</div>
25<div class="section" lang="en">
26<div class="titlepage"><div><div><h2 class="title" style="clear: both">
27<a name="hash.disable"></a> Disabling The Extensions</h2></div></div></div>
28<p>
29      While <code class="computeroutput"><a href="../boost/hash.html" title="Struct template hash">boost::hash</a></code>'s extensions are
30      generally useful, you might want to turn them of in order to check that your
31      code will work with other implementations of TR1. To do this define the macro
32      <code class="computeroutput"><span class="identifier">BOOST_HASH_NO_EXTENSIONS</span></code>. When
33      this macro is defined, only the specialisations detailed in TR1 will be declared.
34      But, if you later undefine the macro and include &lt;<code class="computeroutput"><a href="reference.html#header.boost.functional.hash.hpp" title="Header &lt;boost/functional/hash.hpp&gt;">boost/functional/hash.hpp</a></code>&gt;
35      then the non-specialised form will be defined - activating the extensions.
36    </p>
37<p>
38      It is strongly recommended that you never undefine the macro - and only define
39      it so that it applies to the complete translation unit, either by defining
40      it at the beginning of the main source file or, preferably, by using a compiler
41      switch or preference. And you really should never define it in header files.
42    </p>
43<p>
44      If you are writing a library which has code in the header which requires the
45      extensions, then the best action is to tell users not to define the macro.
46      Their code won't <span class="emphasis"><em>require</em></span> the macro.
47    </p>
48<p>
49      Translation units that are compiled with the macro defined will link with units
50      that were compiled without it. This feature has been designed to avoid ODR
51      violations.
52    </p>
53</div>
54<table width="100%"><tr>
55<td align="left"></td>
56<td align="right"><small>Copyright © 2005, 2006 Daniel James</small></td>
57</tr></table>
58<hr>
59<div class="spirit-nav">
60<a accesskey="p" href="portability.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../hash.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="changes.html"><img src="../images/next.png" alt="Next"></a>
61</div>
62</body>
63</html>
Note: See TracBrowser for help on using the repository browser.