]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/doc/html/boost_typetraits/reference/add_reference.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / type_traits / doc / html / boost_typetraits / reference / add_reference.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>add_reference</title>
5 <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.TypeTraits">
8 <link rel="up" href="../reference.html" title="Alphabetical Reference">
9 <link rel="prev" href="add_pointer.html" title="add_pointer">
10 <link rel="next" href="add_rvalue_reference.html" title="add_rvalue_reference">
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="add_pointer.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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="add_rvalue_reference.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h3 class="title">
27 <a name="boost_typetraits.reference.add_reference"></a><a class="link" href="add_reference.html" title="add_reference">add_reference</a>
28 </h3></div></div></div>
29 <div class="note"><table border="0" summary="Note">
30 <tr>
31 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/src/images/note.png"></td>
32 <th align="left">Note</th>
33 </tr>
34 <tr><td align="left" valign="top"><p>
35 This trait has been made obsolete by <a class="link" href="add_lvalue_reference.html" title="add_lvalue_reference">add_lvalue_reference</a>
36 and <a class="link" href="add_rvalue_reference.html" title="add_rvalue_reference">add_rvalue_reference</a>,
37 and new code should use these new traits rather than <a class="link" href="is_reference.html" title="is_reference">is_reference</a>
38 which is retained for backwards compatibility only.
39 </p></td></tr>
40 </table></div>
41 <pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span>
42 <span class="keyword">struct</span> <span class="identifier">add_reference</span>
43 <span class="special">{</span>
44 <span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
45 <span class="special">};</span>
46 </pre>
47 <p>
48 <span class="bold"><strong>type:</strong></span> If <code class="computeroutput"><span class="identifier">T</span></code>
49 is not a reference type then <code class="computeroutput"><span class="identifier">T</span><span class="special">&amp;</span></code>, otherwise <code class="computeroutput"><span class="identifier">T</span></code>.
50 </p>
51 <p>
52 <span class="bold"><strong>C++ Standard Reference:</strong></span> 8.3.2.
53 </p>
54 <p>
55 <span class="bold"><strong>Header:</strong></span> <code class="computeroutput"> <span class="preprocessor">#include</span>
56 <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">add_reference</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
57 or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
58 </p>
59 <div class="table">
60 <a name="boost_typetraits.reference.add_reference.examples"></a><p class="title"><b>Table&#160;1.14.&#160;Examples</b></p>
61 <div class="table-contents"><table class="table" summary="Examples">
62 <colgroup>
63 <col>
64 <col>
65 </colgroup>
66 <thead><tr>
67 <th>
68 <p>
69 Expression
70 </p>
71 </th>
72 <th>
73 <p>
74 Result Type
75 </p>
76 </th>
77 </tr></thead>
78 <tbody>
79 <tr>
80 <td>
81 <p>
82 <code class="computeroutput"><span class="identifier">add_reference</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
83 </p>
84 </td>
85 <td>
86 <p>
87 <code class="computeroutput"><span class="keyword">int</span><span class="special">&amp;</span></code>
88 </p>
89 </td>
90 </tr>
91 <tr>
92 <td>
93 <p>
94 <code class="computeroutput"><span class="identifier">add_reference</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="keyword">const</span><span class="special">&amp;&gt;::</span><span class="identifier">type</span></code>
95 </p>
96 </td>
97 <td>
98 <p>
99 <code class="computeroutput"><span class="keyword">int</span> <span class="keyword">const</span><span class="special">&amp;</span></code>
100 </p>
101 </td>
102 </tr>
103 <tr>
104 <td>
105 <p>
106 <code class="computeroutput"><span class="identifier">add_reference</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">*&gt;::</span><span class="identifier">type</span></code>
107 </p>
108 </td>
109 <td>
110 <p>
111 <code class="computeroutput"><span class="keyword">int</span><span class="special">*&amp;</span></code>
112 </p>
113 </td>
114 </tr>
115 <tr>
116 <td>
117 <p>
118 <code class="computeroutput"><span class="identifier">add_reference</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">*&amp;&gt;::</span><span class="identifier">type</span></code>
119 </p>
120 </td>
121 <td>
122 <p>
123 <code class="computeroutput"><span class="keyword">int</span><span class="special">*&amp;</span></code>
124 </p>
125 </td>
126 </tr>
127 </tbody>
128 </table></div>
129 </div>
130 <br class="table-break"><p>
131 <span class="bold"><strong>Compiler Compatibility:</strong></span> All current compilers
132 are supported by this trait.
133 </p>
134 </div>
135 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
136 <td align="left"></td>
137 <td align="right"><div class="copyright-footer">Copyright &#169; 2000, 2011 Adobe Systems Inc, David Abrahams,
138 Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
139 Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
140 Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
141 Watanabe<p>
142 Distributed under the Boost Software License, Version 1.0. (See accompanying
143 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>)
144 </p>
145 </div></td>
146 </tr></table>
147 <hr>
148 <div class="spirit-nav">
149 <a accesskey="p" href="add_pointer.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.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="add_rvalue_reference.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
150 </div>
151 </body>
152 </html>