add_volatile.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>add_volatile</title>
  5. <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.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_rvalue_reference.html" title="add_rvalue_reference">
  10. <link rel="next" href="aligned_storage.html" title="aligned_storage">
  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_rvalue_reference.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="aligned_storage.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_volatile"></a><a class="link" href="add_volatile.html" title="add_volatile">add_volatile</a>
  28. </h3></div></div></div>
  29. <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>
  30. <span class="keyword">struct</span> <span class="identifier">add_volatile</span>
  31. <span class="special">{</span>
  32. <span class="keyword">typedef</span> <em class="replaceable"><code>see-below</code></em> <span class="identifier">type</span><span class="special">;</span>
  33. <span class="special">};</span>
  34. <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> <span class="keyword">using</span> <span class="identifier">add_volatile_t</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">add_volatile</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</span><span class="identifier">type</span><span class="special">;</span> <span class="comment">// C++11 and above</span>
  35. </pre>
  36. <p>
  37. <span class="bold"><strong>type:</strong></span> The same type as <code class="computeroutput"><span class="identifier">T</span>
  38. <span class="keyword">volatile</span></code> for all <code class="computeroutput"><span class="identifier">T</span></code>.
  39. </p>
  40. <p>
  41. <span class="bold"><strong>C++ Standard Reference:</strong></span> 3.9.3.
  42. </p>
  43. <p>
  44. <span class="bold"><strong>Header:</strong></span> <code class="computeroutput"> <span class="preprocessor">#include</span>
  45. <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_volatile</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
  46. 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>
  47. </p>
  48. <div class="table">
  49. <a name="boost_typetraits.reference.add_volatile.examples"></a><p class="title"><b>Table&#160;1.16.&#160;Examples</b></p>
  50. <div class="table-contents"><table class="table" summary="Examples">
  51. <colgroup>
  52. <col>
  53. <col>
  54. </colgroup>
  55. <thead><tr>
  56. <th>
  57. <p>
  58. Expression
  59. </p>
  60. </th>
  61. <th>
  62. <p>
  63. Result Type
  64. </p>
  65. </th>
  66. </tr></thead>
  67. <tbody>
  68. <tr>
  69. <td>
  70. <p>
  71. <code class="computeroutput"><span class="identifier">add_volatile</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
  72. </p>
  73. </td>
  74. <td>
  75. <p>
  76. <code class="computeroutput"><span class="keyword">int</span> <span class="keyword">volatile</span></code>
  77. </p>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td>
  82. <p>
  83. <code class="computeroutput"><span class="identifier">add_volatile</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&amp;&gt;::</span><span class="identifier">type</span></code>
  84. </p>
  85. </td>
  86. <td>
  87. <p>
  88. <code class="computeroutput"><span class="keyword">int</span><span class="special">&amp;</span></code>
  89. </p>
  90. </td>
  91. </tr>
  92. <tr>
  93. <td>
  94. <p>
  95. <code class="computeroutput"><span class="identifier">add_volatile</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">*&gt;::</span><span class="identifier">type</span></code>
  96. </p>
  97. </td>
  98. <td>
  99. <p>
  100. <code class="computeroutput"><span class="keyword">int</span><span class="special">*</span>
  101. <span class="keyword">volatile</span></code>
  102. </p>
  103. </td>
  104. </tr>
  105. <tr>
  106. <td>
  107. <p>
  108. <code class="computeroutput"><span class="identifier">add_volatile</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="keyword">const</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
  109. </p>
  110. </td>
  111. <td>
  112. <p>
  113. <code class="computeroutput"><span class="keyword">int</span> <span class="keyword">const</span>
  114. <span class="keyword">volatile</span></code>
  115. </p>
  116. </td>
  117. </tr>
  118. </tbody>
  119. </table></div>
  120. </div>
  121. <br class="table-break"><p>
  122. <span class="bold"><strong>Compiler Compatibility:</strong></span> All current compilers
  123. are supported by this trait.
  124. </p>
  125. </div>
  126. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  127. <td align="left"></td>
  128. <td align="right"><div class="copyright-footer">Copyright &#169; 2000, 2011 Adobe Systems Inc, David Abrahams,
  129. Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
  130. Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
  131. Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
  132. Watanabe<p>
  133. Distributed under the Boost Software License, Version 1.0. (See accompanying
  134. 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>)
  135. </p>
  136. </div></td>
  137. </tr></table>
  138. <hr>
  139. <div class="spirit-nav">
  140. <a accesskey="p" href="add_rvalue_reference.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="aligned_storage.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
  141. </div>
  142. </body>
  143. </html>