mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-29 20:37:17 +02:00
updated docs
[SVN r29099]
This commit is contained in:
@ -3,16 +3,17 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.3.6: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.3.8: http://docutils.sourceforge.net/" />
|
||||
<title>pointee and indirect_reference</title>
|
||||
<meta name="author" content="David Abrahams" />
|
||||
<meta name="organization" content="Boost Consulting" />
|
||||
<meta name="date" content="2004-11-01" />
|
||||
<meta name="date" content="2005-02-27" />
|
||||
<meta name="copyright" content="Copyright David Abrahams 2004." />
|
||||
<link rel="stylesheet" href="default.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="title"><tt class="literal"><span class="pre">pointee</span></tt> and <tt class="literal"><span class="pre">indirect_reference</span></tt></h1>
|
||||
<div class="document" id="pointee-and-indirect-reference">
|
||||
<h1 class="title"><tt class="docutils literal"><span class="pre">pointee</span></tt> and <tt class="docutils literal"><span class="pre">indirect_reference</span></tt></h1>
|
||||
<table class="docinfo" frame="void" rules="none">
|
||||
<col class="docinfo-name" />
|
||||
<col class="docinfo-content" />
|
||||
@ -24,13 +25,12 @@
|
||||
<tr><th class="docinfo-name">Organization:</th>
|
||||
<td><a class="first last reference" href="http://www.boost-consulting.com">Boost Consulting</a></td></tr>
|
||||
<tr><th class="docinfo-name">Date:</th>
|
||||
<td>2004-11-01</td></tr>
|
||||
<td>2005-02-27</td></tr>
|
||||
<tr><th class="docinfo-name">Copyright:</th>
|
||||
<td>Copyright David Abrahams 2004.</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="document" id="pointee-and-indirect-reference">
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
@ -54,13 +54,13 @@ void f(Dereferenceable p)
|
||||
}
|
||||
</pre>
|
||||
<div class="section" id="pointee">
|
||||
<h2><a name="pointee"><tt class="literal"><span class="pre">pointee</span></tt></a></h2>
|
||||
<h2><a name="pointee"><tt class="docutils literal"><span class="pre">pointee</span></tt></a></h2>
|
||||
<p>It turns out to be impossible to come up with a fully-general
|
||||
algorithm to do determine <em>what-goes-here</em> directly, but it is
|
||||
possible to require that <tt class="literal"><span class="pre">pointee<Dereferenceable>::type</span></tt> is
|
||||
correct. Naturally, <tt class="literal"><span class="pre">pointee</span></tt> has the same difficulty: it can't
|
||||
determine the appropriate <tt class="literal"><span class="pre">::type</span></tt> reliably for all
|
||||
<tt class="literal"><span class="pre">Dereferenceable</span></tt>s, but it makes very good guesses (it works
|
||||
possible to require that <tt class="docutils literal"><span class="pre">pointee<Dereferenceable>::type</span></tt> is
|
||||
correct. Naturally, <tt class="docutils literal"><span class="pre">pointee</span></tt> has the same difficulty: it can't
|
||||
determine the appropriate <tt class="docutils literal"><span class="pre">::type</span></tt> reliably for all
|
||||
<tt class="docutils literal"><span class="pre">Dereferenceable</span></tt>s, but it makes very good guesses (it works
|
||||
for all pointers, standard and boost smart pointers, and
|
||||
iterators), and when it guesses wrongly, it can be specialized as
|
||||
necessary:</p>
|
||||
@ -76,21 +76,21 @@ namespace boost
|
||||
</pre>
|
||||
</div>
|
||||
<div class="section" id="indirect-reference">
|
||||
<h2><a name="indirect-reference"><tt class="literal"><span class="pre">indirect_reference</span></tt></a></h2>
|
||||
<p><tt class="literal"><span class="pre">indirect_reference<T>::type</span></tt> is rather more specialized than
|
||||
<tt class="literal"><span class="pre">pointee</span></tt>, and is meant to be used to forward the result of
|
||||
<h2><a name="indirect-reference"><tt class="docutils literal"><span class="pre">indirect_reference</span></tt></a></h2>
|
||||
<p><tt class="docutils literal"><span class="pre">indirect_reference<T>::type</span></tt> is rather more specialized than
|
||||
<tt class="docutils literal"><span class="pre">pointee</span></tt>, and is meant to be used to forward the result of
|
||||
dereferencing an object of its argument type. Most dereferenceable
|
||||
types just return a reference to their pointee, but some return
|
||||
proxy references or return the pointee by value. When that
|
||||
information is needed, call on <tt class="literal"><span class="pre">indirect_reference</span></tt>.</p>
|
||||
information is needed, call on <tt class="docutils literal"><span class="pre">indirect_reference</span></tt>.</p>
|
||||
<p>Both of these templates are essential to the correct functioning of
|
||||
<a class="reference" href="indirect_iterator.html"><tt class="literal"><span class="pre">indirect_iterator</span></tt></a>.</p>
|
||||
<a class="reference" href="indirect_iterator.html"><tt class="docutils literal"><span class="pre">indirect_iterator</span></tt></a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="reference">
|
||||
<h1><a name="reference">Reference</a></h1>
|
||||
<div class="section" id="id1">
|
||||
<h2><a name="id1"><tt class="literal"><span class="pre">pointee</span></tt></a></h2>
|
||||
<h2><a name="id1"><tt class="docutils literal"><span class="pre">pointee</span></tt></a></h2>
|
||||
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
|
||||
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
@ -101,22 +101,22 @@ struct pointee
|
||||
typedef /* see below */ type;
|
||||
};
|
||||
</pre>
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field"><th class="field-name">Requires:</th><td class="field-body">For an object <tt class="literal"><span class="pre">x</span></tt> of type <tt class="literal"><span class="pre">Dereferenceable</span></tt>, <tt class="literal"><span class="pre">*x</span></tt>
|
||||
is well-formed. If <tt class="literal"><span class="pre">++x</span></tt> is ill-formed it shall neither be
|
||||
<tr class="field"><th class="field-name">Requires:</th><td class="field-body">For an object <tt class="docutils literal"><span class="pre">x</span></tt> of type <tt class="docutils literal"><span class="pre">Dereferenceable</span></tt>, <tt class="docutils literal"><span class="pre">*x</span></tt>
|
||||
is well-formed. If <tt class="docutils literal"><span class="pre">++x</span></tt> is ill-formed it shall neither be
|
||||
ambiguous nor shall it violate access control, and
|
||||
<tt class="literal"><span class="pre">Dereferenceable::element_type</span></tt> shall be an accessible type.
|
||||
Otherwise <tt class="literal"><span class="pre">iterator_traits<Dereferenceable>::value_type</span></tt> shall
|
||||
<tt class="docutils literal"><span class="pre">Dereferenceable::element_type</span></tt> shall be an accessible type.
|
||||
Otherwise <tt class="docutils literal"><span class="pre">iterator_traits<Dereferenceable>::value_type</span></tt> shall
|
||||
be well formed. [Note: These requirements need not apply to
|
||||
explicit or partial specializations of <tt class="literal"><span class="pre">pointee</span></tt>]</td>
|
||||
explicit or partial specializations of <tt class="docutils literal"><span class="pre">pointee</span></tt>]</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><tt class="literal"><span class="pre">type</span></tt> is determined according to the following algorithm, where
|
||||
<tt class="literal"><span class="pre">x</span></tt> is an object of type <tt class="literal"><span class="pre">Dereferenceable</span></tt>:</p>
|
||||
<p><tt class="docutils literal"><span class="pre">type</span></tt> is determined according to the following algorithm, where
|
||||
<tt class="docutils literal"><span class="pre">x</span></tt> is an object of type <tt class="docutils literal"><span class="pre">Dereferenceable</span></tt>:</p>
|
||||
<pre class="literal-block">
|
||||
if ( ++x is ill-formed )
|
||||
{
|
||||
@ -134,7 +134,7 @@ else
|
||||
</pre>
|
||||
</div>
|
||||
<div class="section" id="id2">
|
||||
<h2><a name="id2"><tt class="literal"><span class="pre">indirect_reference</span></tt></a></h2>
|
||||
<h2><a name="id2"><tt class="docutils literal"><span class="pre">indirect_reference</span></tt></a></h2>
|
||||
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
|
||||
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
@ -145,22 +145,22 @@ struct indirect_reference
|
||||
typedef /* see below */ type;
|
||||
};
|
||||
</pre>
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
<table class="docutils field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field"><th class="field-name">Requires:</th><td class="field-body">For an object <tt class="literal"><span class="pre">x</span></tt> of type <tt class="literal"><span class="pre">Dereferenceable</span></tt>, <tt class="literal"><span class="pre">*x</span></tt>
|
||||
is well-formed. If <tt class="literal"><span class="pre">++x</span></tt> is ill-formed it shall neither be
|
||||
<tr class="field"><th class="field-name">Requires:</th><td class="field-body">For an object <tt class="docutils literal"><span class="pre">x</span></tt> of type <tt class="docutils literal"><span class="pre">Dereferenceable</span></tt>, <tt class="docutils literal"><span class="pre">*x</span></tt>
|
||||
is well-formed. If <tt class="docutils literal"><span class="pre">++x</span></tt> is ill-formed it shall neither be
|
||||
ambiguous nor shall it violate access control, and
|
||||
<tt class="literal"><span class="pre">pointee<Dereferenceable>::type&</span></tt> shall be well-formed.
|
||||
Otherwise <tt class="literal"><span class="pre">iterator_traits<Dereferenceable>::reference</span></tt> shall
|
||||
<tt class="docutils literal"><span class="pre">pointee<Dereferenceable>::type&</span></tt> shall be well-formed.
|
||||
Otherwise <tt class="docutils literal"><span class="pre">iterator_traits<Dereferenceable>::reference</span></tt> shall
|
||||
be well formed. [Note: These requirements need not apply to
|
||||
explicit or partial specializations of <tt class="literal"><span class="pre">indirect_reference</span></tt>]</td>
|
||||
explicit or partial specializations of <tt class="docutils literal"><span class="pre">indirect_reference</span></tt>]</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><tt class="literal"><span class="pre">type</span></tt> is determined according to the following algorithm, where
|
||||
<tt class="literal"><span class="pre">x</span></tt> is an object of type <tt class="literal"><span class="pre">Dereferenceable</span></tt>:</p>
|
||||
<p><tt class="docutils literal"><span class="pre">type</span></tt> is determined according to the following algorithm, where
|
||||
<tt class="docutils literal"><span class="pre">x</span></tt> is an object of type <tt class="docutils literal"><span class="pre">Dereferenceable</span></tt>:</p>
|
||||
<pre class="literal-block">
|
||||
if ( ++x is ill-formed )
|
||||
return ``pointee<Dereferenceable>::type&``
|
||||
@ -170,7 +170,7 @@ else
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="footer" />
|
||||
<hr class="docutils footer" />
|
||||
<div class="footer">
|
||||
<a class="reference" href="pointee.rst">View document source</a>.
|
||||
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
|
||||
|
Reference in New Issue
Block a user