| 1 | <html> |
|---|
| 2 | <head> |
|---|
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
|---|
| 4 | <title> Implementation</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="../boost_tr1.html" title="Chapter 16. Boost.TR1"> |
|---|
| 9 | <link rel="prev" href="header_list.html" title=" TR1 By Header"> |
|---|
| 10 | <link rel="next" href="testing.html" title=" Testing"> |
|---|
| 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="header_list.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_tr1.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="testing.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="boost_tr1.implementation"></a> Implementation</h2></div></div></div> |
|---|
| 28 | <p> |
|---|
| 29 | When Boost.TR1 is <a href="config.html" title=" Configuration">configured</a> to make |
|---|
| 30 | use of your standard library's native TR1 implementation, then it doesn't do |
|---|
| 31 | very much: it just includes the appropriate header. |
|---|
| 32 | </p> |
|---|
| 33 | <p> |
|---|
| 34 | When Boost.TR1 is using the Boost implementation of a particular component, |
|---|
| 35 | then it includes the appropriate Boost header(s) and imports the necessary |
|---|
| 36 | declarations in <code class="computeroutput"><span class="keyword">namespace</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tr1</span></code> |
|---|
| 37 | with using declarations. Note that only those declarations that are part of |
|---|
| 38 | the standard are imported: the implementation is deliberately quite strict |
|---|
| 39 | about not including any Boost-specific extensions in <code class="computeroutput"><span class="keyword">namespace</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tr1</span></code>, |
|---|
| 40 | in order to catch any portability errors in user code. If you really need to |
|---|
| 41 | use Boost-specific extensions then you should include the Boost headers directly |
|---|
| 42 | and use the declarations in <code class="computeroutput"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span></code> instead. |
|---|
| 43 | Note that this style of implementation is not completely standards-conforming, |
|---|
| 44 | in particular it is not possible to add user-defined template specializations |
|---|
| 45 | of TR1 components into <code class="computeroutput"><span class="keyword">namespace</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tr1</span></code>. |
|---|
| 46 | There are also one or two Boost libraries that are not yet fully standards |
|---|
| 47 | conforming, any such non-conformities are documented in <a href="subject_list.html" title=" TR1 By Subject">the |
|---|
| 48 | TR1 by subject section</a>. Hopefully, occurrences of non-standard behavior |
|---|
| 49 | should be extremely rare in practice however. |
|---|
| 50 | </p> |
|---|
| 51 | <p> |
|---|
| 52 | If you use the standard conforming header includes (in <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tr1</span><span class="special">/</span><span class="identifier">tr1</span></code>) then these header names can sometimes |
|---|
| 53 | conflict with existing standard library headers (for example <code class="computeroutput"><span class="identifier">shared_ptr</span></code> is added to the existing standard |
|---|
| 54 | library header <code class="computeroutput"><span class="special"><</span><span class="identifier">memory</span><span class="special">></span></code> rather than it's own header). These headers |
|---|
| 55 | forward on to your existing standard library header in one of two ways: for |
|---|
| 56 | gcc it uses <code class="computeroutput"><span class="preprocessor">#include_next</span></code>, |
|---|
| 57 | and for other compilers it uses the macro <code class="computeroutput"><span class="identifier">BOOST_TR1_STD_HEADER</span><span class="special">(</span><span class="identifier">header</span><span class="special">)</span></code> |
|---|
| 58 | (defined in <a href="../../../boost/tr1/detail/config.hpp%22" target="_top">boost/tr1/detail/config.hpp</a>) |
|---|
| 59 | which evaluates to <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><../</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">header</span><span class="special">></span></code>. |
|---|
| 60 | This should work "straight out the box" for most compilers, but does |
|---|
| 61 | mean that these headers should <span class="bold"><strong>never</strong></span> be placed |
|---|
| 62 | inside a directory called "include" that is already in your compiler's |
|---|
| 63 | search path. |
|---|
| 64 | </p> |
|---|
| 65 | </div> |
|---|
| 66 | <table width="100%"><tr> |
|---|
| 67 | <td align="left"></td> |
|---|
| 68 | <td align="right"><small>Copyright © 2005 John Maddock</small></td> |
|---|
| 69 | </tr></table> |
|---|
| 70 | <hr> |
|---|
| 71 | <div class="spirit-nav"> |
|---|
| 72 | <a accesskey="p" href="header_list.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../boost_tr1.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="testing.html"><img src="../images/next.png" alt="Next"></a> |
|---|
| 73 | </div> |
|---|
| 74 | </body> |
|---|
| 75 | </html> |
|---|