1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>Disabling The Extensions</title> 6<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css"> 7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 8<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> 9<link rel="up" href="../hash.html" title="Chapter 10. Boost.ContainerHash"> 10<link rel="prev" href="portability.html" title="Portability"> 11<link rel="next" href="changes.html" title="Change Log"> 12</head> 13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 14<table cellpadding="2" width="100%"><tr> 15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td> 16<td align="center"><a href="../../../index.html">Home</a></td> 17<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> 18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 20<td align="center"><a href="../../../more/index.htm">More</a></td> 21</tr></table> 22<hr> 23<div class="spirit-nav"> 24<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> 25</div> 26<div class="section"> 27<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 28<a name="hash.disable"></a><a class="link" href="disable.html" title="Disabling The Extensions">Disabling The Extensions</a> 29</h2></div></div></div> 30<p> 31 While <code class="computeroutput"><a class="link" href="../boost/hash.html" title="Struct template hash">boost::hash</a></code>'s extensions are 32 generally useful, you might want to turn them of in order to check that your 33 code will work with other implementations of TR1. To do this define the macro 34 <code class="computeroutput"><span class="identifier">BOOST_HASH_NO_EXTENSIONS</span></code>. When 35 this macro is defined, only the specialisations detailed in TR1 will be declared. 36 But, if you later undefine the macro and include <<code class="computeroutput"><a class="link" href="reference.html#header.boost.container_hash.hash_hpp" title="Header <boost/container_hash/hash.hpp>">boost/container_hash/hash.hpp</a></code>> 37 then the non-specialised form will be defined - activating the extensions. 38 </p> 39<p> 40 It is strongly recommended that you never undefine the macro - and only define 41 it so that it applies to the complete translation unit, either by defining 42 it at the beginning of the main source file or, preferably, by using a compiler 43 switch or preference. And you really should never define it in header files. 44 </p> 45<p> 46 If you are writing a library which has code in the header which requires the 47 extensions, then the best action is to tell users not to define the macro. 48 Their code won't <span class="emphasis"><em>require</em></span> the macro. 49 </p> 50<p> 51 Translation units that are compiled with the macro defined will link with units 52 that were compiled without it. This feature has been designed to avoid ODR 53 violations. 54 </p> 55</div> 56<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 57<td align="left"></td> 58<td align="right"><div class="copyright-footer">Copyright © 2005-2008 Daniel 59 James<p> 60 Distributed under the Boost Software License, Version 1.0. (See accompanying 61 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>) 62 </p> 63</div></td> 64</tr></table> 65<hr> 66<div class="spirit-nav"> 67<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> 68</div> 69</body> 70</html> 71