1
0
forked from boostorg/bind

initial commit

[SVN r10915]
This commit is contained in:
Peter Dimov
2001-08-23 18:47:44 +00:00
commit b87bb90661
2 changed files with 273 additions and 0 deletions

96
.gitattributes vendored Normal file
View File

@ -0,0 +1,96 @@
* text=auto !eol svneol=native#text/plain
*.gitattributes text svneol=native#text/plain
# Scriptish formats
*.bat text svneol=native#text/plain
*.bsh text svneol=native#text/x-beanshell
*.cgi text svneol=native#text/plain
*.cmd text svneol=native#text/plain
*.js text svneol=native#text/javascript
*.php text svneol=native#text/x-php
*.pl text svneol=native#text/x-perl
*.pm text svneol=native#text/x-perl
*.py text svneol=native#text/x-python
*.sh eol=lf svneol=LF#text/x-sh
configure eol=lf svneol=LF#text/x-sh
# Image formats
*.bmp binary svneol=unset#image/bmp
*.gif binary svneol=unset#image/gif
*.ico binary svneol=unset#image/ico
*.jpeg binary svneol=unset#image/jpeg
*.jpg binary svneol=unset#image/jpeg
*.png binary svneol=unset#image/png
*.tif binary svneol=unset#image/tiff
*.tiff binary svneol=unset#image/tiff
*.svg text svneol=native#image/svg%2Bxml
# Data formats
*.pdf binary svneol=unset#application/pdf
*.avi binary svneol=unset#video/avi
*.doc binary svneol=unset#application/msword
*.dsp text svneol=crlf#text/plain
*.dsw text svneol=crlf#text/plain
*.eps binary svneol=unset#application/postscript
*.gz binary svneol=unset#application/gzip
*.mov binary svneol=unset#video/quicktime
*.mp3 binary svneol=unset#audio/mpeg
*.ppt binary svneol=unset#application/vnd.ms-powerpoint
*.ps binary svneol=unset#application/postscript
*.psd binary svneol=unset#application/photoshop
*.rdf binary svneol=unset#text/rdf
*.rss text svneol=unset#text/xml
*.rtf binary svneol=unset#text/rtf
*.sln text svneol=native#text/plain
*.swf binary svneol=unset#application/x-shockwave-flash
*.tgz binary svneol=unset#application/gzip
*.vcproj text svneol=native#text/xml
*.vcxproj text svneol=native#text/xml
*.vsprops text svneol=native#text/xml
*.wav binary svneol=unset#audio/wav
*.xls binary svneol=unset#application/vnd.ms-excel
*.zip binary svneol=unset#application/zip
# Text formats
.htaccess text svneol=native#text/plain
*.bbk text svneol=native#text/xml
*.cmake text svneol=native#text/plain
*.css text svneol=native#text/css
*.dtd text svneol=native#text/xml
*.htm text svneol=native#text/html
*.html text svneol=native#text/html
*.ini text svneol=native#text/plain
*.log text svneol=native#text/plain
*.mak text svneol=native#text/plain
*.qbk text svneol=native#text/plain
*.rst text svneol=native#text/plain
*.sql text svneol=native#text/x-sql
*.txt text svneol=native#text/plain
*.xhtml text svneol=native#text/xhtml%2Bxml
*.xml text svneol=native#text/xml
*.xsd text svneol=native#text/xml
*.xsl text svneol=native#text/xml
*.xslt text svneol=native#text/xml
*.xul text svneol=native#text/xul
*.yml text svneol=native#text/plain
boost-no-inspect text svneol=native#text/plain
CHANGES text svneol=native#text/plain
COPYING text svneol=native#text/plain
INSTALL text svneol=native#text/plain
Jamfile text svneol=native#text/plain
Jamroot text svneol=native#text/plain
Jamfile.v2 text svneol=native#text/plain
Jamrules text svneol=native#text/plain
Makefile* text svneol=native#text/plain
README text svneol=native#text/plain
TODO text svneol=native#text/plain
# Code formats
*.c text svneol=native#text/plain
*.cpp text svneol=native#text/plain
*.h text svneol=native#text/plain
*.hpp text svneol=native#text/plain
*.ipp text svneol=native#text/plain
*.tpp text svneol=native#text/plain
*.jam text svneol=native#text/plain
*.java text svneol=native#text/plain

177
ref.html Normal file
View File

@ -0,0 +1,177 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost: ref.hpp documentation</title>
</head>
<body bgcolor="White">
<table border="0" width="100%">
<tr>
<td align="center">
<table border="0" width="90%">
<tr>
<td width="277">
<img src="../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" height="86">
</td>
<td align="center">
<table border="0">
<tr><td nowrap><h1>ref.hpp</h1></td></tr>
<tr><td align="right" nowrap><small>&nbsp;1.00.0003 (2001-08-22)</small></td></tr>
</table>
</td>
</tr>
<tr>
<td height="64">&nbsp;</td>
</tr>
</table>
<table border="0" width="90%">
<tr>
<td>
<h2>Files</h2>
<ul>
<li><a href="../../boost/ref.hpp">ref.hpp</a>
</ul>
<h2>Purpose</h2>
<p>
The header <a href="../../boost/ref.hpp">boost/ref.hpp</a> defines the class template
<b>boost::reference_wrapper&lt;T&gt;</b> and the two functions <b>boost::ref</b> and
<b>boost::cref</b> that return instances of <b>boost::reference_wrapper&lt;T&gt;</b>.
</p>
<p>
The purpose of <b>boost::reference_wrapper&lt;T&gt;</b> is to contain a reference to
an object of type <b>T</b>. It is primarily used to "feed" references to
function templates (algorithms) that take their parameter by value.
</p>
<p>
To support this usage, <b>boost::reference_wrapper&lt;T&gt;</b> provides an implicit
conversion to <b>T &amp;</b>. This usually allows the function templates to
work on references unmodified.
</p>
<p>
<b>boost::reference_wrapper&lt;T&gt;</b> is <b>CopyConstructible</b>, but it is not
<b>Assignable</b>.
</p>
<p>
The expression <b>boost::ref(x)</b> returns a <b>boost::reference_wrapper&lt;X&gt;(x)</b>
where <b>X</b> is the type of <b>x</b>. Similarly, <b>boost::cref(x)</b>
returns a <b>boost::reference_wrapper&lt;X const&gt;(x)</b>.
</p>
<h2>Interface</h2>
<h3>Synopsis</h3>
<pre>
namespace boost
{
template&lt;class T&gt; class <a href="#reference_wrapper">reference_wrapper</a>;
template&lt;class T&gt; reference_wrapper&lt;T&gt; <a href="#ref">ref</a>(T &amp; t);
template&lt;class T&gt; reference_wrapper&lt;T const&gt; <a href="#cref">cref</a>(T const &amp; t);
}
</pre>
<h3><a name="reference_wrapper">reference_wrapper</a></h3>
<pre>
template&lt;class T&gt; class reference_wrapper
{
public:
explicit <a href="#rt_construct">reference_wrapper</a>(T &amp; t);
<a href="#rt_operator">operator T &amp;</a> () const;
T &amp; <a href="#rt_get">get</a>() const;
};
</pre>
<h4><a name="rt_construct">explicit reference_wrapper(T &amp; t)</a></h4>
<p>
<b>Effects:</b> Constructs a <b>reference_wrapper</b> object that stores a reference to <b>t</b>.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
<h4><a name="rt_operator">operator T &amp; () const</a></h4>
<p>
<b>Returns:</b> the stored reference.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
<h4><a name="rt_get">T &amp; get() const</a></h4>
<p>
<b>Returns:</b> the stored reference.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
<h3><a name="ref">ref</a></h3>
<pre>
template&lt;class T&gt; reference_wrapper&lt;T&gt; ref(T &amp; t);
</pre>
<p>
<b>Returns:</b> <tt>reference_wrapper&lt;T&gt;(t)</tt>.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
<h3><a name="cref">cref</a></h3>
<pre>
template&lt;class T&gt; reference_wrapper&lt;T const&gt; cref(T const &amp; t);
</pre>
<p>
<b>Returns:</b> <tt>reference_wrapper&lt;T const&gt;(t)</tt>.
</p>
<p>
<b>Throws:</b> Nothing.
</p>
<h2>Acknowledgements</h2>
<p>
<b>ref</b> and <b>cref</b> were originally part of the Boost.Tuple library.
They were "promoted to <b>boost::</b> status" because they are generally
useful.
</p>
<p><br><br><br><small>Copyright &copy; 2001 by Peter Dimov and Multi Media
Ltd. Permission to copy, use, modify, sell and distribute this document is
granted provided this copyright notice appears in all copies. This document
is provided &quot;as is&quot; without express or implied warranty, and with
no claim as to its suitability for any purpose.</small></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>