Brian Silverman | 5962333 | 2018-08-04 23:36:56 -0700 | [diff] [blame^] | 1 | <?xml version="1.0" encoding="utf-8" ?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 6 | <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" /> |
| 7 | <title>Readable Iterator Concept</title> |
| 8 | <link rel="stylesheet" href="../../../rst.css" type="text/css" /> |
| 9 | </head> |
| 10 | <body> |
| 11 | <div class="document" id="readable-iterator-concept"> |
| 12 | <h1 class="title">Readable Iterator Concept</h1> |
| 13 | |
| 14 | <!-- Copyright David Abrahams 2006. Distributed under the Boost --> |
| 15 | <!-- Software License, Version 1.0. (See accompanying --> |
| 16 | <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> |
| 17 | <p>A class or built-in type <tt class="docutils literal"><span class="pre">X</span></tt> models the <em>Readable Iterator</em> concept |
| 18 | for value type <tt class="docutils literal"><span class="pre">T</span></tt> if, in addition to <tt class="docutils literal"><span class="pre">X</span></tt> being Assignable and |
| 19 | Copy Constructible, the following expressions are valid and respect |
| 20 | the stated semantics. <tt class="docutils literal"><span class="pre">U</span></tt> is the type of any specified member of |
| 21 | type <tt class="docutils literal"><span class="pre">T</span></tt>.</p> |
| 22 | <table border="1" class="docutils"> |
| 23 | <colgroup> |
| 24 | <col width="28%" /> |
| 25 | <col width="20%" /> |
| 26 | <col width="52%" /> |
| 27 | </colgroup> |
| 28 | <thead valign="bottom"> |
| 29 | <tr><th class="head" colspan="3">Readable Iterator Requirements (in addition to Assignable and Copy Constructible)</th> |
| 30 | </tr> |
| 31 | <tr><th class="head">Expression</th> |
| 32 | <th class="head">Return Type</th> |
| 33 | <th class="head">Note/Precondition</th> |
| 34 | </tr> |
| 35 | </thead> |
| 36 | <tbody valign="top"> |
| 37 | <tr><td><tt class="docutils literal"><span class="pre">iterator_traits<X>::value_type</span></tt></td> |
| 38 | <td><tt class="docutils literal"><span class="pre">T</span></tt></td> |
| 39 | <td>Any non-reference, |
| 40 | non-cv-qualified type</td> |
| 41 | </tr> |
| 42 | <tr><td><tt class="docutils literal"><span class="pre">*a</span></tt></td> |
| 43 | <td>Convertible to <tt class="docutils literal"><span class="pre">T</span></tt></td> |
| 44 | <td><dl class="first last docutils"> |
| 45 | <dt>pre: <tt class="docutils literal"><span class="pre">a</span></tt> is dereferenceable. If <tt class="docutils literal"><span class="pre">a</span> <span class="pre">==</span> <span class="pre">b</span></tt> then <tt class="docutils literal"><span class="pre">*a</span></tt></dt> |
| 46 | <dd>is equivalent to <tt class="docutils literal"><span class="pre">*b</span></tt>.</dd> |
| 47 | </dl> |
| 48 | </td> |
| 49 | </tr> |
| 50 | <tr><td><tt class="docutils literal"><span class="pre">a->m</span></tt></td> |
| 51 | <td><tt class="docutils literal"><span class="pre">U&</span></tt></td> |
| 52 | <td>pre: <tt class="docutils literal"><span class="pre">pre:</span> <span class="pre">(*a).m</span></tt> is well-defined. Equivalent to <tt class="docutils literal"><span class="pre">(*a).m</span></tt>.</td> |
| 53 | </tr> |
| 54 | </tbody> |
| 55 | </table> |
| 56 | </div> |
| 57 | <div class="footer"> |
| 58 | <hr class="footer" /> |
| 59 | <a class="reference external" href="ReadableIterator.rst">View document source</a>. |
| 60 | Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. |
| 61 | |
| 62 | </div> |
| 63 | </body> |
| 64 | </html> |