diff options
Diffstat (limited to 'doc/html/reference_wrapper.html')
-rw-r--r-- | doc/html/reference_wrapper.html | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/doc/html/reference_wrapper.html b/doc/html/reference_wrapper.html new file mode 100644 index 0000000000..4955d98d16 --- /dev/null +++ b/doc/html/reference_wrapper.html @@ -0,0 +1,140 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Class template reference_wrapper</title> +<link rel="stylesheet" href="boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets V1.69.1"> +<link rel="start" href="index.html" title="The Boost C++ Libraries"> +<link rel="up" href="ref/reference.html#header.boost.ref.hpp" title="Header <boost/ref.hpp>"> +<link rel="prev" href="ref/reference.html" title="Reference"> +<link rel="next" href="is_reference_wrapper.html" title="Class template is_reference_wrapper"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table cellpadding="2" width="100%"> +<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../boost.png"></td> +<td align="center"><a href="../../index.htm">Home</a></td> +<td align="center"><a href="../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="../../people/people.htm">People</a></td> +<td align="center"><a href="../../more/faq.htm">FAQ</a></td> +<td align="center"><a href="../../more/index.htm">More</a></td> +</table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="ref/reference.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="ref/reference.html#header.boost.ref.hpp"><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="is_reference_wrapper.html"><img src="images/next.png" alt="Next"></a> +</div> +<div class="refentry" lang="en"> +<a name="reference_wrapper"></a><div class="titlepage"></div> +<div class="refnamediv"> +<h2><span class="refentrytitle">Class template reference_wrapper</span></h2> +<p>boost::reference_wrapper — + Contains a reference to an object of type + <code class="computeroutput">T</code>. + </p> +</div> +<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> +<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> +<span class="bold"><strong>class</strong></span> reference_wrapper { +<span class="bold"><strong>public</strong></span>: + <span class="emphasis"><em>// types</em></span> + <span class="bold"><strong>typedef</strong></span> T type; + + <span class="emphasis"><em>// <a href="reference_wrapper.html#reference_wrapperconstruct-copy-destruct">construct/copy/destruct</a></em></span> + <span class="bold"><strong>explicit</strong></span> <a href="reference_wrapper.html#id2496965-bb">reference_wrapper</a>(T&); + + <span class="emphasis"><em>// <a href="reference_wrapper.html#id2365507-bb">access</a></em></span> + <a href="reference_wrapper.html#id2365512-bb"><span class="bold"><strong>operator</strong></span> T&</a>() <span class="bold"><strong>const</strong></span>; + <span class="type">T&</span> <a href="reference_wrapper.html#id2357385-bb">get</a>() <span class="bold"><strong>const</strong></span>; + <span class="type">T*</span> <a href="reference_wrapper.html#id2490294-bb">get_pointer</a>() <span class="bold"><strong>const</strong></span>; +}; + +<span class="emphasis"><em>// <a href="reference_wrapper.html#id2366485-bb">constructors</a></em></span> +<span class="type">reference_wrapper<T></span> <a href="reference_wrapper.html#id2366489">ref</a>(T&); +<span class="type">reference_wrapper<T <span class="bold"><strong>const</strong></span>></span> <a href="reference_wrapper.html#cref">cref</a>(T <span class="bold"><strong>const</strong></span>&);</pre></div> +<div class="refsect1" lang="en"> +<a name="id2730530"></a><h2>Description</h2> +<p><code class="computeroutput"><a href="reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a></code> + is primarily used to "feed" references to function templates + (algorithms) that take their parameter by value. It provides + an implicit conversion to + <code class="computeroutput">T&</code>, which usually allows + the function templates to work on references + unmodified.</p> +<div class="refsect2" lang="en"> +<a name="id2730555"></a><h3> +<a name="reference_wrapperconstruct-copy-destruct"></a><code class="computeroutput">reference_wrapper</code> construct/copy/destruct</h3> +<div class="orderedlist"><ol type="1"><li> +<pre class="literallayout"><span class="bold"><strong>explicit</strong></span> <a name="id2496965-bb"></a>reference_wrapper(T& t);</pre> +<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: + + Constructs a + <code class="computeroutput"><a href="reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a></code> + object that stores a reference to + <code class="computeroutput">t</code>.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: + + Does not throw.</p> +</li></ol></div> +</div> +<div class="refsect2" lang="en"> +<a name="id2730629"></a><h3> +<a name="id2365507-bb"></a><code class="computeroutput">reference_wrapper</code> access</h3> +<div class="orderedlist"><ol type="1"> +<li> +<pre class="literallayout"><a name="id2365512-bb"></a><span class="bold"><strong>operator</strong></span> T&() <span class="bold"><strong>const</strong></span>;</pre> +<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: + + The stored reference.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: + + Does not throw.</p> +</li> +<li> +<pre class="literallayout"><span class="type">T&</span> <a name="id2357385-bb"></a>get() <span class="bold"><strong>const</strong></span>;</pre> +<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: + + The stored reference.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: + + Does not throw.</p> +</li> +<li> +<pre class="literallayout"><span class="type">T*</span> <a name="id2490294-bb"></a>get_pointer() <span class="bold"><strong>const</strong></span>;</pre> +<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: + + A pointer to the object referenced by the stored reference.<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: + + Does not throw.</p> +</li> +</ol></div> +</div> +<div class="refsect2" lang="en"> +<a name="id2730771"></a><h3> +<a name="id2366485-bb"></a><code class="computeroutput">reference_wrapper</code> constructors</h3> +<div class="orderedlist"><ol type="1"> +<li> +<pre class="literallayout"><span class="type">reference_wrapper<T></span> <a name="id2366489"></a>ref(T& t);</pre> +<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: + + <code class="computeroutput"><a href="reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a><T>(t)</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: + + Does not throw.</p> +</li> +<li> +<pre class="literallayout"><span class="type">reference_wrapper<T <span class="bold"><strong>const</strong></span>></span> <a name="cref"></a>cref(T <span class="bold"><strong>const</strong></span>& t);</pre> +<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: + + <code class="computeroutput"><a href="reference_wrapper.html" title="Class template reference_wrapper">reference_wrapper</a><T const>(t)</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: + + Does not throw.</p> +</li> +</ol></div> +</div> +</div> +</div> +<table width="100%"><tr> +<td align="left"></td> +<td align="right"><small>Copyright © 1999, 2000 Jaakko Järvi<br>Copyright © 2001, 2002 Peter Dimov<br>Copyright © 2002 David Abrahams</small></td> +</tr></table> +<hr> +<div class="spirit-nav"> +<a accesskey="p" href="ref/reference.html"><img src="images/prev.png" alt="Prev"></a><a accesskey="u" href="ref/reference.html#header.boost.ref.hpp"><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="is_reference_wrapper.html"><img src="images/next.png" alt="Next"></a> +</div> +</body> +</html> |