mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-23 01:17:16 +02:00
A few fixes
[SVN r23542]
This commit is contained in:
238
doc/GNUmakefile
238
doc/GNUmakefile
@ -1,11 +1,233 @@
|
||||
# GNUmakefile for postprocessing PDF files
|
||||
#
|
||||
# <20> 2000 IBM Corporation.
|
||||
# Licensed under the GNU GPL.
|
||||
|
||||
########################################################################
|
||||
# Make sure that the following macros are correct for your setup
|
||||
########################################################################
|
||||
# ... System utilities
|
||||
RMRF = /bin/rm -rf
|
||||
MV = /bin/mv
|
||||
EGREP = /bin/egrep
|
||||
ECHO = /bin/echo
|
||||
PERL = /usr/bin/perl
|
||||
PYTHON = python
|
||||
CAT = /bin/cat
|
||||
TOUCH = /bin/touch
|
||||
ZIP = /usr/bin/zip
|
||||
|
||||
all:
|
||||
@${ECHO} "<boost-root>/libs/iterator/doc/GNUmakefile should be replaced by"
|
||||
@${ECHO}
|
||||
@${ECHO} " http://www.boost-consulting.com/writing/GNUmakefile,"
|
||||
@${ECHO}
|
||||
@${ECHO} "before proceeding. That file is not included in the Boost"
|
||||
@${ECHO} "distribution because it is licensed under the GPL, which violates"
|
||||
@${ECHO} "Boost license requirements."
|
||||
# ... TeX & postprocessors
|
||||
PPOWER4 = ppower4
|
||||
PDFLATEX = pdflatex
|
||||
METAPOST = mpost
|
||||
FIG2DEV = fig2dev
|
||||
BIBTEX = bibtex
|
||||
FOLIAGECUTTER = foliageCutter --verbose
|
||||
RST2LATEX = rst2latex
|
||||
RST2HTML = rst2html
|
||||
|
||||
TEX = latex
|
||||
export TEX
|
||||
########################################################################
|
||||
# End of user servicable parts; don't fiddle with the remainder of this
|
||||
# makefile unless you know what you do.
|
||||
#
|
||||
# You have been warned ;=)
|
||||
########################################################################
|
||||
|
||||
# ... Variables
|
||||
TEXFILES = $(strip $(wildcard *.tex))
|
||||
RSTFILES = $(strip $(wildcard *.rst))
|
||||
-include GNUmakefile.local
|
||||
TEXSTEMS = $(strip $(patsubst %.tex,%,${TEXFILES}))
|
||||
RSTSTEMS = $(strip $(patsubst %.rst,%,${RSTFILES}))
|
||||
CUTFOILS = $(strip $(patsubst %,%---toc.tex,${TEXSTEMS}))
|
||||
PDFFILES = $(strip $(patsubst %.tex,%.pdf,${TEXFILES}))
|
||||
PRINTS = $(patsubst %.pdf,%-print.pdf,${PDFFILES})
|
||||
PRINTZIP = prints.zip
|
||||
SLIDEZIP = slides.zip
|
||||
|
||||
# ... Depend
|
||||
DEPENDFILES = .depend
|
||||
GENFILE = .generated
|
||||
|
||||
# ... List of extensions and files generated
|
||||
texcrap = *.mpx *.log *.aux *.blg *-print.brf *-print.tex *.out
|
||||
|
||||
mpxcrap = mpxerr.tex mpxerr.pdf
|
||||
|
||||
generated = *.out *.[0-9] *.[0-9][0-9] *.bbl *.brf \
|
||||
*.mp *.mmp *.pdf *.ps TMP-*.pdf *.ftoc\
|
||||
${PRINTZIP} ${SLIDEZIP} ${GENFILE} ${DEPENDFILES} \
|
||||
${texcrap} ${mpxcrap} ${CUTFOILS} $(strip $(wildcard *---*.tex))
|
||||
|
||||
|
||||
# ... canned command to run PDFLaTeX
|
||||
define run-pdflatex
|
||||
@${ECHO} ""
|
||||
@${ECHO} "---- Running PDFLaTeX on $<" && ${PDFLATEX} $<
|
||||
@${ECHO} "---- Running PDFLaTeX on $< again" && ${PDFLATEX} $<
|
||||
-@(${EGREP} -qi 'Rerun to get' $*.log && \
|
||||
${ECHO} "---- Rerunning PDFLaTeX on $* to get cross-refs right" && \
|
||||
${PDFLATEX} $<) || \
|
||||
${ECHO} "---- No cross-refs correcting PDFLaTeX rerun required for $*"
|
||||
-@(${EGREP} -qi $*.ftoc $*.log && \
|
||||
${ECHO} "---- Rerunning PDFLaTeX on $* for FTOC" && \
|
||||
${PDFLATEX} $<) || \
|
||||
${ECHO} "---- No FTOC PDFLaTeX run required for $*"
|
||||
-@(${EGREP} -qi 'Warning: Citation' $*.log && \
|
||||
${ECHO} "---- Running BIBTeX on $*" && \
|
||||
${BIBTEX} $* && \
|
||||
${ECHO} "---- Running PDFLaTeX on $<" && \
|
||||
${PDFLATEX} $<) || \
|
||||
${ECHO} "---- No BIBTeX run required for $*"
|
||||
-@(${EGREP} -qi 'Warning: .+undefined references' $*.log && \
|
||||
${ECHO} "---- Running PDFLaTeX on $<" && \
|
||||
${PDFLATEX} $<) || \
|
||||
${ECHO} "---- No further PDFLaTex run required for $<"
|
||||
@${ECHO} "Generated: $@ {$<}" >> ${GENFILE}
|
||||
@${RMRF} ${texcrap}
|
||||
endef
|
||||
|
||||
# ... canned command to run PDFLaTeX for printable versions
|
||||
define run-pdflatex-for-print
|
||||
@${ECHO} ""
|
||||
@${ECHO} "---- Running PDFLaTeX on $*-print.tex" && ${PDFLATEX} $*-print.tex
|
||||
@${ECHO} "---- Running PDFLaTeX on $< again" && ${PDFLATEX} $<
|
||||
-@(${EGREP} -qi 'Warning: Citation' $*-print.log && \
|
||||
${ECHO} "---- Running BIBTeX on $*-print" && \
|
||||
${BIBTEX} $*-print && \
|
||||
${ECHO} "---- Running PDFLaTeX on $*-print.tex" && \
|
||||
${PDFLATEX} $*-print.tex) || \
|
||||
${ECHO} "---- No BIBTeX run required for $*"
|
||||
-@(${EGREP} -qi 'Warning: .+undefined references' $*-print.log && \
|
||||
${ECHO} "---- Running PDFLaTeX on $*-print" && \
|
||||
${PDFLATEX} $*-print.tex) || \
|
||||
${ECHO} "---- No further PDFLaTex run required for $*-print"
|
||||
@${ECHO} "Generated: $@ {$<}" >> ${GENFILE}
|
||||
@${RMRF} ${texcrap}
|
||||
endef
|
||||
|
||||
# DWA begin modifications
|
||||
# ... Rule: How to generate TeX from ReST
|
||||
%.tex: %.txt
|
||||
@${ECHO} "---- Running rst2latex on $<"
|
||||
${RST2LATEX} $< $@
|
||||
@${ECHO} "Generated: $@ {$<}" >> ${GENFILE}
|
||||
|
||||
# ... Rule: How to generate TeX from ReST
|
||||
%.tex: %.rst
|
||||
@${ECHO} "---- Running rst2latex on $<"
|
||||
${RST2LATEX} $< $@
|
||||
@${ECHO} "Generated: $@ {$<}" >> ${GENFILE}
|
||||
|
||||
# ... Rule: How to generate HTML from ReST
|
||||
%.html: %.txt
|
||||
@${ECHO} "---- Running rst2html on $<"
|
||||
${RST2HTML} $< $@
|
||||
@${ECHO} "Generated: $@ {$<}" >> ${GENFILE}
|
||||
|
||||
# ... Rule: How to generate HTML from ReST
|
||||
%.html: %.rst
|
||||
@${ECHO} "---- Running rst2html on $<"
|
||||
${RST2HTML} $< $@
|
||||
@${ECHO} "Generated: $@ {$<}" >> ${GENFILE}
|
||||
# DWA end modifications
|
||||
|
||||
# ... Rule: How to generate PDF from TeX
|
||||
%.pdf: %.tex
|
||||
$(run-pdflatex)
|
||||
@${MV} $@ TMP-$@
|
||||
@${ECHO} "---- Running PPower4 on $*"
|
||||
${PPOWER4} -v TMP-$@ $@
|
||||
@${RMRF} TMP-$@
|
||||
@${ECHO} "Postprocessed: $*.pdf {$*.pdf}" >> ${GENFILE}
|
||||
|
||||
# ... Rule: How to generate printable PDF from TeX
|
||||
%-print.pdf: %.tex
|
||||
${PERL} -pe 's/^\\documentclass\[(.*?)\]/\\documentclass\[$$1,prints\]/;' < $< > $*-print.tex
|
||||
$(run-pdflatex-for-print)
|
||||
@${ECHO} "Generated: $*-print.pdf {$*.pdf}" >> ${GENFILE}
|
||||
|
||||
# ... Rule: How to generate cut foils from TeX master
|
||||
%---toc.tex: %.tex
|
||||
${FOLIAGECUTTER} --prefix=$* $<
|
||||
|
||||
# ... Rule: How to generate MetaPost from FIG
|
||||
%.mp: %.fig
|
||||
@${ECHO} "---- Running Fig2Dev (mp) on $<"
|
||||
${FIG2DEV} -L mp $< $@
|
||||
@${ECHO} "Generated: $@ {$<}" >> ${GENFILE}
|
||||
|
||||
# ... Rule: How to generate MultiMetaPost from FIG
|
||||
%.mmp: %.fig
|
||||
@${ECHO} "---- Running Fig2Dev (mmp) on $<"
|
||||
${FIG2DEV} -L mmp $< $@
|
||||
@${ECHO} "Generated: $@ {$<}" >> ${GENFILE}
|
||||
|
||||
# ... Rule: How to generate includable PS from FIG via MetaPost
|
||||
%.mps: %.fig
|
||||
@${ECHO} "---- Running Fig2Dev (mps) on $<"
|
||||
${FIG2DEV} -L mp $< $*.mps.mp
|
||||
@${RMRF} $*.mps.[0-9]
|
||||
${METAPOST} $*.mps.mp
|
||||
@${MV} $*.mps.0 $@
|
||||
@${ECHO} "Generated: $@ {$<}" >> ${GENFILE}
|
||||
|
||||
# ... Rule: How to generate includable PS files from MultiMetaPost
|
||||
%.0: %.mmp
|
||||
@${ECHO} "---- Running MetaPost on $<"
|
||||
@${RMRF} $*.[0-9] $*.[0-9][0-9]
|
||||
${METAPOST} $<
|
||||
@${ECHO} "Generated: $*.0{...} {$<}" >> ${GENFILE}
|
||||
|
||||
cleanup-crap:
|
||||
@${RMRF} ${mpxcrap}
|
||||
|
||||
# ... Target: all
|
||||
all: cleanup-crap ${DEPENDFILES} ${PDFFILES} ${PRINTS} ${PRINTZIP} ${SLIDEZIP}
|
||||
@${ECHO} ""
|
||||
@${TOUCH} ${GENFILE}
|
||||
@${CAT} ${GENFILE}
|
||||
@${RMRF} ${GENFILE}
|
||||
|
||||
# ... Target: ZIP files
|
||||
zip zips: ${PRINTZIP} ${SLIDEZIP}
|
||||
|
||||
# ... Target: ZIP file containing printable versions of slides
|
||||
${PRINTZIP}: .depend ${PDFFILES}
|
||||
@${RMRF} ${PRINTZIP}
|
||||
${ZIP} -r ${PRINTZIP} ${PRINTS}
|
||||
@${ECHO} "Generated: ${PRINTZIP}" >> ${GENFILE}
|
||||
|
||||
# ... Target: ZIP file containing screen versions of slides
|
||||
${SLIDEZIP}: .depend ${PDFFILES}
|
||||
@${RMRF} ${SLIDEZIP}
|
||||
${ZIP} -r ${SLIDEZIP} ${PDFFILES}
|
||||
@${ECHO} "Generated: ${SLIDEZIP}" >> ${GENFILE}
|
||||
|
||||
# ... Target: clean up
|
||||
clean:
|
||||
${RMRF} ${generated}
|
||||
|
||||
# ... Target: create dependencies
|
||||
depend: .depend
|
||||
|
||||
# ... Target: dependency file (parse TEXFILES for multiinclude and includegraphics)
|
||||
# .depend: GNUmakefile ${TEXFILES}
|
||||
# ${RMRF} $@
|
||||
# @for t in ${TEXSTEMS} ; do \
|
||||
# ${ECHO} "Scanning $$t.tex"; \
|
||||
# ${PERL} -e 'my $$target = shift @ARGV;' -e 'while (<>) { /\\multiinclude(\[.*?\])?{(.*?)}/ && print "$$target: $$2.0\n";}' $$t.pdf < $$t.tex >> $@; \
|
||||
# ${PERL} -e 'my $$target = shift @ARGV;' -e 'while (<>) { /\\includegraphics(\[.*?\])?{(.*?)\.(.*?)}/ && print "$$target: $$2.$$3\n";}' $$t.pdf < $$t.tex >> $@; \
|
||||
# done
|
||||
|
||||
.depend: GNUmakefile ${RSTFILES}
|
||||
${RMRF} $@
|
||||
${PYTHON} scanrst.py ${RSTFILES} > $@
|
||||
|
||||
# ... include dependency files
|
||||
# -include .depend
|
||||
-include .depend
|
||||
|
||||
|
Binary file not shown.
@ -3,7 +3,7 @@
|
||||
<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.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.3.4: http://docutils.sourceforge.net/" />
|
||||
<title>Iterator Facade and Adaptor</title>
|
||||
<meta name="author" content="David Abrahams, Jeremy Siek, Thomas Witt" />
|
||||
<meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, Zephyr Associates, Inc." />
|
||||
@ -11,7 +11,6 @@
|
||||
<link rel="stylesheet" href="default.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="iterator-facade-and-adaptor">
|
||||
<h1 class="title">Iterator Facade and Adaptor</h1>
|
||||
<table class="docinfo" frame="void" rules="none">
|
||||
<col class="docinfo-name" />
|
||||
@ -32,6 +31,7 @@ committee's library working group.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="document" id="iterator-facade-and-adaptor">
|
||||
<!-- Version 1.9 of this ReStructuredText document corresponds to
|
||||
n1530_, the paper accepted by the LWG. -->
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
@ -53,7 +53,7 @@ by adapting other iterators.</td>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="contents topic" id="table-of-contents">
|
||||
<p class="topic-title"><a name="table-of-contents">Table of Contents</a></p>
|
||||
<p class="topic-title first"><a name="table-of-contents">Table of Contents</a></p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference" href="#motivation" id="id15" name="id15">Motivation</a></li>
|
||||
<li><a class="reference" href="#impact-on-the-standard" id="id16" name="id16">Impact on the Standard</a></li>
|
||||
@ -325,7 +325,7 @@ of the derived iterator type. These member functions are described
|
||||
briefly below and in more detail in the iterator facade
|
||||
requirements.</p>
|
||||
<blockquote>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="44%" />
|
||||
<col width="56%" />
|
||||
@ -443,7 +443,6 @@ are described in terms of a set of requirements, which must be
|
||||
satisfied by the <tt class="literal"><span class="pre">iterator_facade</span></tt> implementation.</p>
|
||||
<table class="citation" frame="void" id="cop95" rules="none">
|
||||
<colgroup><col class="label" /><col /></colgroup>
|
||||
<col />
|
||||
<tbody valign="top">
|
||||
<tr><td class="label"><a class="fn-backref" href="#id4" name="cop95">[Cop95]</a></td><td>[Coplien, 1995] Coplien, J., Curiously Recurring Template
|
||||
Patterns, C++ Report, February 1995, pp. 24-27.</td></tr>
|
||||
@ -776,8 +775,8 @@ object of a single pass iterator type interoperable with <tt class="literal"><sp
|
||||
is a constant object of a random access traversal iterator type
|
||||
interoperable with <tt class="literal"><span class="pre">X</span></tt>.</p>
|
||||
<a class="target" id="core-operations" name="core-operations"></a><div class="topic">
|
||||
<p class="topic-title"><tt class="literal"><span class="pre">iterator_facade</span></tt> Core Operations</p>
|
||||
<table border class="table">
|
||||
<p class="topic-title first"><tt class="literal"><span class="pre">iterator_facade</span></tt> Core Operations</p>
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="21%" />
|
||||
<col width="23%" />
|
||||
@ -1774,7 +1773,7 @@ type <tt class="literal"><span class="pre">iterator_traits<Iterator>::refe
|
||||
traversal and iterator access concepts modeled by its <tt class="literal"><span class="pre">Iterator</span></tt>
|
||||
argument. In addition, it may model old iterator concepts
|
||||
specified in the following table:</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="53%" />
|
||||
<col width="47%" />
|
||||
@ -1981,7 +1980,7 @@ concept that is modeled by the <tt class="literal"><span class="pre">Iterator</s
|
||||
<p>If <tt class="literal"><span class="pre">transform_iterator</span></tt> is a model of Readable Lvalue Iterator then
|
||||
it models the following original iterator concepts depending on what
|
||||
the <tt class="literal"><span class="pre">Iterator</span></tt> argument models.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="47%" />
|
||||
<col width="53%" />
|
||||
@ -2038,17 +2037,20 @@ initialized to <tt class="literal"><span class="pre">f</span></tt> and <tt class
|
||||
</tbody>
|
||||
</table>
|
||||
<pre class="literal-block">
|
||||
template<class OtherIterator, class R2, class V2>
|
||||
template<class F2, class I2, class R2, class V2>
|
||||
transform_iterator(
|
||||
transform_iterator<UnaryFunction, OtherIterator, R2, V2> const& t
|
||||
, typename enable_if_convertible<OtherIterator, Iterator>::type* = 0 // exposition
|
||||
transform_iterator<F2, I2, R2, V2> const& t
|
||||
, typename enable_if_convertible<I2, Iterator>::type* = 0 // exposition only
|
||||
, typename enable_if_convertible<F2, UnaryFunction>::type* = 0 // exposition only
|
||||
);
|
||||
</pre>
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">An instance of <tt class="literal"><span class="pre">transform_iterator</span></tt> that is a copy of <tt class="literal"><span class="pre">t</span></tt>.</td>
|
||||
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">An instance of <tt class="literal"><span class="pre">transform_iterator</span></tt> with <tt class="literal"><span class="pre">m_f</span></tt>
|
||||
initialized to <tt class="literal"><span class="pre">t.functor()</span></tt> and <tt class="literal"><span class="pre">m_iterator</span></tt> initialized to
|
||||
<tt class="literal"><span class="pre">t.base()</span></tt>.</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="literal"><span class="pre">OtherIterator</span></tt> is implicitly convertible to <tt class="literal"><span class="pre">Iterator</span></tt>.</td>
|
||||
</tr>
|
||||
@ -2174,7 +2176,7 @@ the expression <tt class="literal"><span class="pre">p(x)</span></tt> must be va
|
||||
<p>The concepts that <tt class="literal"><span class="pre">filter_iterator</span></tt> models are dependent on which
|
||||
concepts the <tt class="literal"><span class="pre">Iterator</span></tt> argument models, as specified in the
|
||||
following tables.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="33%" />
|
||||
<col width="67%" />
|
||||
@ -2193,7 +2195,7 @@ following tables.</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="41%" />
|
||||
<col width="59%" />
|
||||
@ -2215,7 +2217,7 @@ following tables.</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="63%" />
|
||||
<col width="38%" />
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -3,13 +3,13 @@
|
||||
<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.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.3.4: http://docutils.sourceforge.net/" />
|
||||
<title>The Boost.Iterator Library Boost</title>
|
||||
<link rel="stylesheet" href="default.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="the-boost-iterator-library-logo">
|
||||
<h1 class="title">The Boost.Iterator Library <a class="reference" href="../../../index.htm"><img alt="Boost" src="../../../c++boost.gif" /></a></h1>
|
||||
<div class="document" id="the-boost-iterator-library-logo">
|
||||
<hr />
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
@ -51,7 +51,7 @@ older Boost Iterator Adaptor Library.</td>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="contents topic" id="table-of-contents">
|
||||
<p class="topic-title"><a name="table-of-contents"><strong>Table of Contents</strong></a></p>
|
||||
<p class="topic-title first"><a name="table-of-contents"><strong>Table of Contents</strong></a></p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference" href="#new-style-iterators" id="id22" name="id22">New-Style Iterators</a></li>
|
||||
<li><a class="reference" href="#iterator-facade-and-adaptor" id="id23" name="id23">Iterator Facade and Adaptor</a></li>
|
||||
@ -218,7 +218,6 @@ near-complete rewrite of the prototype, they came up with the
|
||||
library you see today.</p>
|
||||
<table class="citation" frame="void" id="cop95" rules="none">
|
||||
<colgroup><col class="label" /><col /></colgroup>
|
||||
<col />
|
||||
<tbody valign="top">
|
||||
<tr><td class="label"><a class="fn-backref" href="#id21" name="cop95">[Cop95]</a></td><td>[Coplien, 1995] Coplien, J., Curiously Recurring Template
|
||||
Patterns, C++ Report, February 1995, pp. 24-27.</td></tr>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -3,16 +3,15 @@
|
||||
<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.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.3.4: http://docutils.sourceforge.net/" />
|
||||
<title>New Iterator Concepts</title>
|
||||
<meta name="author" content="David Abrahams, Jeremy Siek, Thomas Witt" />
|
||||
<meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, Zephyr Associates, Inc." />
|
||||
<meta name="date" content="2004-04-06" />
|
||||
<meta name="date" content="2004-07-14" />
|
||||
<meta name="copyright" content="Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved" />
|
||||
<link rel="stylesheet" href="default.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="new-iterator-concepts">
|
||||
<h1 class="title">New Iterator Concepts</h1>
|
||||
<table class="docinfo" frame="void" rules="none">
|
||||
<col class="docinfo-name" />
|
||||
@ -26,7 +25,7 @@
|
||||
<td><a class="first reference" href="http://www.boost-consulting.com">Boost Consulting</a>, Indiana University <a class="reference" href="http://www.osl.iu.edu">Open Systems
|
||||
Lab</a>, <a class="last reference" href="http://www.styleadvisor.com">Zephyr Associates, Inc.</a></td></tr>
|
||||
<tr><th class="docinfo-name">Date:</th>
|
||||
<td>2004-04-06</td></tr>
|
||||
<td>2004-07-14</td></tr>
|
||||
<tr class="field"><th class="docinfo-name">Number:</th><td class="field-body">This is a revised version of <a class="reference" href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1550.html">n1550</a>=03-0133, which was
|
||||
accepted for Technical Report 1 by the C++ standard
|
||||
committee's library working group. This proposal is a
|
||||
@ -37,6 +36,7 @@ revision of paper <a class="reference" href="http://anubis.dkuug.dk/jtc1/sc22/wg
|
||||
2003. All rights reserved</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="document" id="new-iterator-concepts">
|
||||
<!-- Version 1.25 of this ReStructuredText document is the same as
|
||||
n1550_, the paper accepted by the LWG. -->
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
@ -52,7 +52,7 @@ of iterators that are used in practice.</td>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="contents topic" id="table-of-contents">
|
||||
<p class="topic-title"><a name="table-of-contents">Table of Contents</a></p>
|
||||
<p class="topic-title first"><a name="table-of-contents">Table of Contents</a></p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference" href="#motivation" id="id1" name="id1">Motivation</a></li>
|
||||
<li><a class="reference" href="#impact-on-the-standard" id="id2" name="id2">Impact on the Standard</a><ul>
|
||||
@ -107,7 +107,7 @@ geared towards iterator traversal (hence the category names), while
|
||||
requirements that address value access sneak in at various places. The
|
||||
following table gives a summary of the current value access
|
||||
requirements in the iterator categories.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="31%" />
|
||||
<col width="69%" />
|
||||
@ -364,7 +364,7 @@ for value type <tt class="literal"><span class="pre">T</span></tt> if, in additi
|
||||
Copy Constructible, the following expressions are valid and respect
|
||||
the stated semantics. <tt class="literal"><span class="pre">U</span></tt> is the type of any specified member of
|
||||
type <tt class="literal"><span class="pre">T</span></tt>.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="28%" />
|
||||
<col width="20%" />
|
||||
@ -406,7 +406,7 @@ non-cv-qualified type</td>
|
||||
if, in addition to <tt class="literal"><span class="pre">X</span></tt> being Copy Constructible, the following
|
||||
expressions are valid and respect the stated semantics. Writable
|
||||
Iterators have an associated <em>set of value types</em>.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="37%" />
|
||||
<col width="21%" />
|
||||
@ -435,7 +435,7 @@ value types of <tt class="literal"><span class="pre">X</span></tt></td>
|
||||
<p>A class or built-in type <tt class="literal"><span class="pre">X</span></tt> models the <em>Swappable Iterator</em> concept
|
||||
if, in addition to <tt class="literal"><span class="pre">X</span></tt> being Copy Constructible, the following
|
||||
expressions are valid and respect the stated semantics.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="37%" />
|
||||
<col width="19%" />
|
||||
@ -457,17 +457,16 @@ exchanged</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<dl>
|
||||
<dt>[<em>Note:</em> An iterator that is a model of the <em>Readable</em> and <em>Writable Iterator</em> concepts</dt>
|
||||
<dd>is also a model of <em>Swappable Iterator</em>. <em>--end note</em>]</dd>
|
||||
</dl>
|
||||
<p>[<em>Note:</em> An iterator that is a model of the <a class="reference" href="#readable-iterator">Readable Iterator</a> and
|
||||
<a class="reference" href="#writable-iterator">Writable Iterator</a> concepts is also a model of <em>Swappable
|
||||
Iterator</em>. <em>--end note</em>]</p>
|
||||
</div>
|
||||
<div class="section" id="lvalue-iterators-lib-lvalue-iterators">
|
||||
<h4><a class="toc-backref" href="#id14" name="lvalue-iterators-lib-lvalue-iterators">Lvalue Iterators [lib.lvalue.iterators]</a></h4>
|
||||
<p>The <em>Lvalue Iterator</em> concept adds the requirement that the return
|
||||
type of <tt class="literal"><span class="pre">operator*</span></tt> type be a reference to the value type of the
|
||||
iterator.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="22%" />
|
||||
<col width="19%" />
|
||||
@ -487,14 +486,15 @@ iterator.</p>
|
||||
<td><tt class="literal"><span class="pre">T</span></tt> is <em>cv</em>
|
||||
<tt class="literal"><span class="pre">iterator_traits<X>::value_type</span></tt>
|
||||
where <em>cv</em> is an optional
|
||||
cv-qualification.
|
||||
pre: <tt class="literal"><span class="pre">a</span></tt> is
|
||||
dereferenceable. If <tt class="literal"><span class="pre">a</span>
|
||||
<span class="pre">==</span> <span class="pre">b</span></tt> then <tt class="literal"><span class="pre">*a</span></tt> is
|
||||
equivalent to <tt class="literal"><span class="pre">*b</span></tt>.</td>
|
||||
cv-qualification. pre: <tt class="literal"><span class="pre">a</span></tt> is
|
||||
dereferenceable.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>If <tt class="literal"><span class="pre">X</span></tt> is a <a class="reference" href="#writable-iterator">Writable Iterator</a> then <tt class="literal"><span class="pre">a</span> <span class="pre">==</span> <span class="pre">b</span></tt> if and only if
|
||||
<tt class="literal"><span class="pre">*a</span></tt> is the same object as <tt class="literal"><span class="pre">*b</span></tt>. If <tt class="literal"><span class="pre">X</span></tt> is a <a class="reference" href="#readable-iterator">Readable
|
||||
Iterator</a> then <tt class="literal"><span class="pre">a</span> <span class="pre">==</span> <span class="pre">b</span></tt> implies <tt class="literal"><span class="pre">*a</span></tt> is the same object as
|
||||
<tt class="literal"><span class="pre">*b</span></tt>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="iterator-traversal-concepts-lib-iterator-traversal">
|
||||
@ -509,18 +509,18 @@ type <tt class="literal"><span class="pre">X</span></tt>, <tt class="literal"><s
|
||||
concept if, in addition to <tt class="literal"><span class="pre">X</span></tt> being Assignable and Copy
|
||||
Constructible, the following expressions are valid and respect the
|
||||
stated semantics.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="39%" />
|
||||
<col width="37%" />
|
||||
<col width="24%" />
|
||||
<col width="38%" />
|
||||
<col width="23%" />
|
||||
</colgroup>
|
||||
<thead valign="bottom">
|
||||
<tr><th colspan="3">Incrementable Iterator Requirements (in addition to Assignable, Copy Constructible)</th>
|
||||
</tr>
|
||||
<tr><th>Expression</th>
|
||||
<th>Return Type</th>
|
||||
<th>Assertion/Semantics</th>
|
||||
<th>Assertion</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody valign="top">
|
||||
@ -529,15 +529,12 @@ stated semantics.</p>
|
||||
<td><tt class="literal"><span class="pre">&r</span> <span class="pre">==</span> <span class="pre">&++r</span></tt></td>
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">r++</span></tt></td>
|
||||
<td><tt class="literal"><span class="pre">X</span></tt></td>
|
||||
<td><pre class="first last literal-block">
|
||||
{
|
||||
X tmp = r;
|
||||
++r;
|
||||
return tmp;
|
||||
}
|
||||
</pre>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">*r++</span></tt></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">iterator_traversal<X>::type</span></tt></td>
|
||||
<td>Convertible to
|
||||
@ -546,6 +543,11 @@ stated semantics.</p>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>If <tt class="literal"><span class="pre">X</span></tt> is a <a class="reference" href="#writable-iterator">Writable Iterator</a> then <tt class="literal"><span class="pre">X</span> <span class="pre">a(r++);</span></tt> is equivalent
|
||||
to <tt class="literal"><span class="pre">X</span> <span class="pre">a(r);</span> <span class="pre">++r;</span></tt> and <tt class="literal"><span class="pre">*r++</span> <span class="pre">=</span> <span class="pre">o</span></tt> is equivalent
|
||||
to <tt class="literal"><span class="pre">*r</span> <span class="pre">=</span> <span class="pre">o;</span> <span class="pre">++r</span></tt>.
|
||||
If <tt class="literal"><span class="pre">X</span></tt> is a <a class="reference" href="#readable-iterator">Readable Iterator</a> then <tt class="literal"><span class="pre">T</span> <span class="pre">z(*r++);</span></tt> is equivalent
|
||||
to <tt class="literal"><span class="pre">T</span> <span class="pre">z(*r);</span> <span class="pre">++r;</span></tt>.</p>
|
||||
<!-- TR1: incrementable_iterator_tag changed to
|
||||
incrementable_traversal_tag for consistency. -->
|
||||
</div>
|
||||
@ -554,25 +556,29 @@ incrementable_traversal_tag for consistency. -->
|
||||
<p>A class or built-in type <tt class="literal"><span class="pre">X</span></tt> models the <em>Single Pass Iterator</em>
|
||||
concept if the following expressions are valid and respect the stated
|
||||
semantics.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="36%" />
|
||||
<col width="33%" />
|
||||
<col width="31%" />
|
||||
<col width="32%" />
|
||||
<col width="29%" />
|
||||
<col width="13%" />
|
||||
<col width="27%" />
|
||||
</colgroup>
|
||||
<thead valign="bottom">
|
||||
<tr><th colspan="3">Single Pass Iterator Requirements (in addition to Incrementable Iterator and Equality
|
||||
<tr><th colspan="4">Single Pass Iterator Requirements (in addition to Incrementable Iterator and Equality
|
||||
Comparable)</th>
|
||||
</tr>
|
||||
<tr><th>Expression</th>
|
||||
<th>Return Type</th>
|
||||
<th>Assertion/Semantics /
|
||||
<th>Operational
|
||||
Semantics</th>
|
||||
<th>Assertion/
|
||||
Pre-/Post-condition</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody valign="top">
|
||||
<tr><td><tt class="literal"><span class="pre">++r</span></tt></td>
|
||||
<td><tt class="literal"><span class="pre">X&</span></tt></td>
|
||||
<td> </td>
|
||||
<td>pre: <tt class="literal"><span class="pre">r</span></tt> is
|
||||
dereferenceable; post:
|
||||
<tt class="literal"><span class="pre">r</span></tt> is dereferenceable or
|
||||
@ -580,17 +586,20 @@ dereferenceable; post:
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">a</span> <span class="pre">==</span> <span class="pre">b</span></tt></td>
|
||||
<td>convertible to <tt class="literal"><span class="pre">bool</span></tt></td>
|
||||
<td> </td>
|
||||
<td><tt class="literal"><span class="pre">==</span></tt> is an equivalence
|
||||
relation over its domain</td>
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">a</span> <span class="pre">!=</span> <span class="pre">b</span></tt></td>
|
||||
<td>convertible to <tt class="literal"><span class="pre">bool</span></tt></td>
|
||||
<td><tt class="literal"><span class="pre">!(a</span> <span class="pre">==</span> <span class="pre">b)</span></tt></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">iterator_traversal<X>::type</span></tt></td>
|
||||
<td>Convertible to
|
||||
<tt class="literal"><span class="pre">single_pass_traversal_tag</span></tt></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -603,7 +612,7 @@ single_pass_traversal_tag for consistency -->
|
||||
concept if, in addition to <tt class="literal"><span class="pre">X</span></tt> meeting the requirements of Default
|
||||
Constructible and Single Pass Iterator, the following expressions are
|
||||
valid and respect the stated semantics.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="38%" />
|
||||
<col width="34%" />
|
||||
@ -650,34 +659,39 @@ forward_traversal_tag for consistency -->
|
||||
Iterator</em> concept if, in addition to <tt class="literal"><span class="pre">X</span></tt> meeting the requirements of
|
||||
Forward Traversal Iterator, the following expressions are valid and
|
||||
respect the stated semantics.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="38%" />
|
||||
<col width="37%" />
|
||||
<col width="25%" />
|
||||
<col width="33%" />
|
||||
<col width="32%" />
|
||||
<col width="14%" />
|
||||
<col width="21%" />
|
||||
</colgroup>
|
||||
<thead valign="bottom">
|
||||
<tr><th colspan="3">Bidirectional Traversal Iterator Requirements (in addition to Forward Traversal
|
||||
<tr><th colspan="4">Bidirectional Traversal Iterator Requirements (in addition to Forward Traversal
|
||||
Iterator)</th>
|
||||
</tr>
|
||||
<tr><th>Expression</th>
|
||||
<th>Return Type</th>
|
||||
<th>Assertion/Semantics /
|
||||
<th>Operational
|
||||
Semantics</th>
|
||||
<th>Assertion/
|
||||
Pre-/Post-condition</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody valign="top">
|
||||
<tr><td><tt class="literal"><span class="pre">--r</span></tt></td>
|
||||
<td><tt class="literal"><span class="pre">X&</span></tt></td>
|
||||
<td>pre: there exists
|
||||
<td> </td>
|
||||
<td><p class="first">pre: there exists
|
||||
<tt class="literal"><span class="pre">s</span></tt> such that <tt class="literal"><span class="pre">r</span>
|
||||
<span class="pre">==</span> <span class="pre">++s</span></tt>. post:
|
||||
<tt class="literal"><span class="pre">s</span></tt> is
|
||||
dereferenceable.
|
||||
<tt class="literal"><span class="pre">--(++r)</span> <span class="pre">==</span> <span class="pre">r</span></tt>.
|
||||
dereferenceable.</p>
|
||||
<p class="last"><tt class="literal"><span class="pre">++(--r)</span> <span class="pre">==</span> <span class="pre">r</span></tt>.
|
||||
<tt class="literal"><span class="pre">--r</span> <span class="pre">==</span> <span class="pre">--s</span></tt>
|
||||
implies <tt class="literal"><span class="pre">r</span> <span class="pre">==</span>
|
||||
<span class="pre">s</span></tt>. <tt class="literal"><span class="pre">&r</span> <span class="pre">==</span> <span class="pre">&--r</span></tt>.</td>
|
||||
<span class="pre">s</span></tt>. <tt class="literal"><span class="pre">&r</span> <span class="pre">==</span> <span class="pre">&--r</span></tt>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">r--</span></tt></td>
|
||||
<td>convertible to <tt class="literal"><span class="pre">const</span> <span class="pre">X&</span></tt></td>
|
||||
@ -689,11 +703,13 @@ implies <tt class="literal"><span class="pre">r</span> <span class="pre">==</spa
|
||||
}
|
||||
</pre>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">iterator_traversal<X>::type</span></tt></td>
|
||||
<td>Convertible to
|
||||
<tt class="literal"><span class="pre">bidirectional_traversal_tag</span></tt></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -707,7 +723,7 @@ Iterator</em> concept if the following expressions are valid and respect
|
||||
the stated semantics. In the table below, <tt class="literal"><span class="pre">Distance</span></tt> is
|
||||
<tt class="literal"><span class="pre">iterator_traits<X>::difference_type</span></tt> and <tt class="literal"><span class="pre">n</span></tt> represents a
|
||||
constant object of type <tt class="literal"><span class="pre">Distance</span></tt>.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="28%" />
|
||||
<col width="30%" />
|
||||
@ -772,14 +788,14 @@ value <tt class="literal"><span class="pre">n</span></tt> of
|
||||
<tr><td><tt class="literal"><span class="pre">a[n]</span></tt></td>
|
||||
<td>convertible to T</td>
|
||||
<td><tt class="literal"><span class="pre">*(a</span> <span class="pre">+</span> <span class="pre">n)</span></tt></td>
|
||||
<td>pre: a is a <a class="reference" href="#readable-iterator">readable
|
||||
iterator</a></td>
|
||||
<td>pre: a is a <a class="reference" href="#readable-iterator">Readable
|
||||
Iterator</a></td>
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">a[n]</span> <span class="pre">=</span> <span class="pre">v</span></tt></td>
|
||||
<td>convertible to T</td>
|
||||
<td><tt class="literal"><span class="pre">*(a</span> <span class="pre">+</span> <span class="pre">n)</span> <span class="pre">=</span> <span class="pre">v</span></tt></td>
|
||||
<td>pre: a is a <a class="reference" href="#writable-iterator">writable
|
||||
iterator</a></td>
|
||||
<td>pre: a is a <a class="reference" href="#writable-iterator">Writable
|
||||
Iterator</a></td>
|
||||
</tr>
|
||||
<tr><td><tt class="literal"><span class="pre">a</span> <span class="pre"><</span> <span class="pre">b</span></tt></td>
|
||||
<td>convertible to <tt class="literal"><span class="pre">bool</span></tt></td>
|
||||
@ -823,7 +839,7 @@ respect the stated semantics. In the tables below, <tt class="literal"><span cla
|
||||
of type <tt class="literal"><span class="pre">X</span></tt>, <tt class="literal"><span class="pre">y</span></tt> is an object of type <tt class="literal"><span class="pre">Y</span></tt>, <tt class="literal"><span class="pre">Distance</span></tt> is
|
||||
<tt class="literal"><span class="pre">iterator_traits<Y>::difference_type</span></tt>, and <tt class="literal"><span class="pre">n</span></tt> represents a
|
||||
constant object of type <tt class="literal"><span class="pre">Distance</span></tt>.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="13%" />
|
||||
<col width="27%" />
|
||||
@ -864,7 +880,7 @@ constant object of type <tt class="literal"><span class="pre">Distance</span></t
|
||||
</table>
|
||||
<p>If <tt class="literal"><span class="pre">X</span></tt> and <tt class="literal"><span class="pre">Y</span></tt> both model Random Access Traversal Iterator then
|
||||
the following additional requirements must be met.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="12%" />
|
||||
<col width="25%" />
|
||||
@ -998,5 +1014,10 @@ LocalWords: incrementable xxx min prev inplace png oldeqnew AccessTag struct
|
||||
LocalWords: TraversalTag typename lvalues DWA Hmm JGS mis enum -->
|
||||
</div>
|
||||
</div>
|
||||
<hr class="footer" />
|
||||
<div class="footer">
|
||||
<a class="reference" href="new-iter-concepts.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.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Binary file not shown.
@ -412,8 +412,9 @@ expressions are valid and respect the stated semantics.
|
||||
| | |exchanged |
|
||||
+-------------------------+-------------+-----------------------------+
|
||||
|
||||
[*Note:* An iterator that is a model of the *Readable* and *Writable Iterator* concepts
|
||||
is also a model of *Swappable Iterator*. *--end note*]
|
||||
[*Note:* An iterator that is a model of the `Readable Iterator`_ and
|
||||
`Writable Iterator`_ concepts is also a model of *Swappable
|
||||
Iterator*. *--end note*]
|
||||
|
||||
|
||||
Lvalue Iterators [lib.lvalue.iterators]
|
||||
@ -432,15 +433,13 @@ iterator.
|
||||
| | |``iterator_traits<X>::value_type`` |
|
||||
| | |where *cv* is an optional |
|
||||
| | |cv-qualification. pre: ``a`` is |
|
||||
| | |dereferenceable. If ``X`` is a |
|
||||
| | |*Writable Iterator* then ``a == b``|
|
||||
| | |if and only if ``*a`` is the same |
|
||||
| | |object as ``*b``. If ``X`` is a |
|
||||
| | |*Readable Iterator* then ``a == b``|
|
||||
| | |implies ``*a`` is the same object |
|
||||
| | |as ``*b``. |
|
||||
| | |dereferenceable. |
|
||||
+-------------+-----------+-----------------------------------+
|
||||
|
||||
If ``X`` is a `Writable Iterator`_ then ``a == b`` if and only if
|
||||
``*a`` is the same object as ``*b``. If ``X`` is a `Readable
|
||||
Iterator`_ then ``a == b`` implies ``*a`` is the same object as
|
||||
``*b``.
|
||||
|
||||
|
||||
Iterator Traversal Concepts [lib.iterator.traversal]
|
||||
@ -451,7 +450,6 @@ constant objects of type ``X``, ``r`` and ``s`` are mutable objects of
|
||||
type ``X``, ``T`` is ``std::iterator_traits<X>::value_type``, and
|
||||
``v`` is a constant object of type ``T``.
|
||||
|
||||
|
||||
Incrementable Iterators [lib.incrementable.iterators]
|
||||
-----------------------------------------------------
|
||||
|
||||
@ -460,32 +458,28 @@ concept if, in addition to ``X`` being Assignable and Copy
|
||||
Constructible, the following expressions are valid and respect the
|
||||
stated semantics.
|
||||
|
||||
|
||||
+----------------------------------------------------------------------------------------+
|
||||
+------------------------------------------------------------------------------------+
|
||||
|Incrementable Iterator Requirements (in addition to Assignable, Copy Constructible) |
|
||||
| |
|
||||
+--------------------------------+-------------------------------+-----------------------+
|
||||
|Expression |Return Type |Assertion/Semantics |
|
||||
+================================+===============================+=======================+
|
||||
+--------------------------------+-------------------------------+-------------------+
|
||||
|Expression |Return Type |Assertion |
|
||||
+================================+===============================+===================+
|
||||
|``++r`` |``X&`` |``&r == &++r`` |
|
||||
+--------------------------------+-------------------------------+-----------------------+
|
||||
|``r++`` |convertible to ``const X&`` |``X a(r++);`` is |
|
||||
| | |equivalent to ``X a(r);|
|
||||
| | |++r;`` |
|
||||
+--------------------------------+-------------------------------+-----------------------+
|
||||
|``*r++`` |if ``X`` is a *Readable |If ``X`` is a *Readable|
|
||||
| |Iterator* then ``T`` |Iterator* then ``T |
|
||||
| | |z(*r++);`` is |
|
||||
| | |equivalent to ``T |
|
||||
| | |z(*r); ++r;``. If ``X``|
|
||||
| | |is a *Writable |
|
||||
| | |Iterator* then ``*r++ =|
|
||||
| | |o`` is equivalent to |
|
||||
| | |``*r = o; ++r``. |
|
||||
+--------------------------------+-------------------------------+-----------------------+
|
||||
+--------------------------------+-------------------------------+-------------------+
|
||||
|``r++`` | | |
|
||||
+--------------------------------+-------------------------------+-------------------+
|
||||
|``*r++`` | | |
|
||||
+--------------------------------+-------------------------------+-------------------+
|
||||
|``iterator_traversal<X>::type`` |Convertible to | |
|
||||
| |``incrementable_traversal_tag``| |
|
||||
+--------------------------------+-------------------------------+-----------------------+
|
||||
+--------------------------------+-------------------------------+-------------------+
|
||||
|
||||
|
||||
If ``X`` is a `Writable Iterator`_ then ``X a(r++);`` is equivalent
|
||||
to ``X a(r); ++r;`` and ``*r++ = o`` is equivalent
|
||||
to ``*r = o; ++r``.
|
||||
If ``X`` is a `Readable Iterator`_ then ``T z(*r++);`` is equivalent
|
||||
to ``T z(*r); ++r;``.
|
||||
|
||||
.. TR1: incrementable_iterator_tag changed to
|
||||
incrementable_traversal_tag for consistency.
|
||||
@ -498,26 +492,26 @@ concept if the following expressions are valid and respect the stated
|
||||
semantics.
|
||||
|
||||
|
||||
+------------------------------------------------------------------------------------------+
|
||||
+--------------------------------------------------------------------------------------------------------+
|
||||
|Single Pass Iterator Requirements (in addition to Incrementable Iterator and Equality |
|
||||
|Comparable) |
|
||||
+--------------------------------+-----------------------------+---------------------------+
|
||||
|Expression |Return Type |Assertion/Semantics / |
|
||||
| | |Pre-/Post-condition |
|
||||
+================================+=============================+===========================+
|
||||
|``++r`` |``X&`` |pre: ``r`` is |
|
||||
| | |dereferenceable; post: |
|
||||
| | |``r`` is dereferenceable or|
|
||||
| | |``r`` is past-the-end |
|
||||
+--------------------------------+-----------------------------+---------------------------+
|
||||
|``a == b`` |convertible to ``bool`` |``==`` is an equivalence |
|
||||
| | |relation over its domain |
|
||||
+--------------------------------+-----------------------------+---------------------------+
|
||||
|``a != b`` |convertible to ``bool`` |``!(a == b)`` |
|
||||
+--------------------------------+-----------------------------+---------------------------+
|
||||
|``iterator_traversal<X>::type`` |Convertible to | |
|
||||
| |``single_pass_traversal_tag``| |
|
||||
+--------------------------------+-----------------------------+---------------------------+
|
||||
+--------------------------------+-----------------------------+-------------+---------------------------+
|
||||
|Expression |Return Type | Operational |Assertion/ |
|
||||
| | | Semantics |Pre-/Post-condition |
|
||||
+================================+=============================+=============+===========================+
|
||||
|``++r`` |``X&`` | |pre: ``r`` is |
|
||||
| | | |dereferenceable; post: |
|
||||
| | | |``r`` is dereferenceable or|
|
||||
| | | |``r`` is past-the-end |
|
||||
+--------------------------------+-----------------------------+-------------+---------------------------+
|
||||
|``a == b`` |convertible to ``bool`` | |``==`` is an equivalence |
|
||||
| | | |relation over its domain |
|
||||
+--------------------------------+-----------------------------+-------------+---------------------------+
|
||||
|``a != b`` |convertible to ``bool`` |``!(a == b)``| |
|
||||
+--------------------------------+-----------------------------+-------------+---------------------------+
|
||||
|``iterator_traversal<X>::type`` |Convertible to | | |
|
||||
| |``single_pass_traversal_tag``| | |
|
||||
+--------------------------------+-----------------------------+-------------+---------------------------+
|
||||
|
||||
.. TR1: single_pass_iterator_tag changed to
|
||||
single_pass_traversal_tag for consistency
|
||||
@ -565,35 +559,36 @@ Iterator* concept if, in addition to ``X`` meeting the requirements of
|
||||
Forward Traversal Iterator, the following expressions are valid and
|
||||
respect the stated semantics.
|
||||
|
||||
+--------------------------------------------------------------------------------------+
|
||||
+-----------------------------------------------------------------------------------------------------+
|
||||
|Bidirectional Traversal Iterator Requirements (in addition to Forward Traversal |
|
||||
|Iterator) |
|
||||
+--------------------------------+-------------------------------+---------------------+
|
||||
|Expression |Return Type |Assertion/Semantics /|
|
||||
| | |Pre-/Post-condition |
|
||||
+================================+===============================+=====================+
|
||||
|``--r`` |``X&`` |pre: there exists |
|
||||
| | |``s`` such that ``r |
|
||||
| | |== ++s``. post: |
|
||||
| | |``s`` is |
|
||||
| | |dereferenceable. |
|
||||
| | |``--(++r) == r``. |
|
||||
| | |``--r == --s`` |
|
||||
| | |implies ``r == |
|
||||
| | |s``. ``&r == &--r``. |
|
||||
+--------------------------------+-------------------------------+---------------------+
|
||||
|``r--`` |convertible to ``const X&`` |:: |
|
||||
| | | |
|
||||
| | | { |
|
||||
| | | X tmp = r; |
|
||||
| | | --r; |
|
||||
| | | return tmp; |
|
||||
| | | } |
|
||||
+--------------------------------+-------------------------------+---------------------+
|
||||
|``iterator_traversal<X>::type`` |Convertible to | |
|
||||
| |``bidirectional_traversal_tag``| |
|
||||
| | | |
|
||||
+--------------------------------+-------------------------------+---------------------+
|
||||
+--------------------------------+-------------------------------+--------------+---------------------+
|
||||
|Expression |Return Type | Operational |Assertion/ |
|
||||
| | | Semantics |Pre-/Post-condition |
|
||||
+================================+===============================+==============+=====================+
|
||||
|``--r`` |``X&`` | |pre: there exists |
|
||||
| | | |``s`` such that ``r |
|
||||
| | | |== ++s``. post: |
|
||||
| | | |``s`` is |
|
||||
| | | |dereferenceable. |
|
||||
| | | | |
|
||||
| | | |``++(--r) == r``. |
|
||||
| | | |``--r == --s`` |
|
||||
| | | |implies ``r == |
|
||||
| | | |s``. ``&r == &--r``. |
|
||||
+--------------------------------+-------------------------------+--------------+---------------------+
|
||||
|``r--`` |convertible to ``const X&`` |:: | |
|
||||
| | | | |
|
||||
| | | { | |
|
||||
| | | X tmp = r; | |
|
||||
| | | --r; | |
|
||||
| | | return tmp;| |
|
||||
| | | } | |
|
||||
+--------------------------------+-------------------------------+--------------+---------------------+
|
||||
|``iterator_traversal<X>::type`` |Convertible to | | |
|
||||
| |``bidirectional_traversal_tag``| | |
|
||||
| | | | |
|
||||
+--------------------------------+-------------------------------+--------------+---------------------+
|
||||
|
||||
.. TR1: bidirectional_traversal_iterator_tag changed to
|
||||
bidirectional_traversal_tag for consistency
|
||||
@ -642,11 +637,11 @@ constant object of type ``Distance``.
|
||||
| | | |``a + n == b``. ``b |
|
||||
| | | |== a + (b - a)``. |
|
||||
+-------------------------------+---------------------------------+-------------------------+----------------------+
|
||||
|``a[n]`` |convertible to T |``*(a + n)`` |pre: a is a `readable |
|
||||
| | | |iterator`_ |
|
||||
|``a[n]`` |convertible to T |``*(a + n)`` |pre: a is a `Readable |
|
||||
| | | |Iterator`_ |
|
||||
+-------------------------------+---------------------------------+-------------------------+----------------------+
|
||||
|``a[n] = v`` |convertible to T |``*(a + n) = v`` |pre: a is a `writable |
|
||||
| | | |iterator`_ |
|
||||
|``a[n] = v`` |convertible to T |``*(a + n) = v`` |pre: a is a `Writable |
|
||||
| | | |Iterator`_ |
|
||||
+-------------------------------+---------------------------------+-------------------------+----------------------+
|
||||
|``a < b`` |convertible to ``bool`` |``b - a > 0`` |``<`` is a total |
|
||||
| | | |ordering relation |
|
||||
|
Binary file not shown.
BIN
doc/pointee.pdf
BIN
doc/pointee.pdf
Binary file not shown.
Binary file not shown.
@ -3,7 +3,7 @@
|
||||
<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.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.3.4: http://docutils.sourceforge.net/" />
|
||||
<title>Transform Iterator</title>
|
||||
<meta name="author" content="David Abrahams, Jeremy Siek, Thomas Witt" />
|
||||
<meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, University of Hanover Institute for Transport Railway Operation and Construction" />
|
||||
@ -12,7 +12,6 @@
|
||||
<link rel="stylesheet" href="default.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="transform-iterator">
|
||||
<h1 class="title">Transform Iterator</h1>
|
||||
<table class="docinfo" frame="void" rules="none">
|
||||
<col class="docinfo-name" />
|
||||
@ -32,6 +31,7 @@ Railway Operation and Construction</a></td></tr>
|
||||
<td>Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="document" id="transform-iterator">
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
@ -43,7 +43,7 @@ dereferencing the iterator and returning the result.</td>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="contents topic" id="table-of-contents">
|
||||
<p class="topic-title"><a name="table-of-contents">Table of Contents</a></p>
|
||||
<p class="topic-title first"><a name="table-of-contents">Table of Contents</a></p>
|
||||
<ul class="simple">
|
||||
<li><a class="reference" href="#transform-iterator-synopsis" id="id2" name="id2"><tt class="literal"><span class="pre">transform_iterator</span></tt> synopsis</a></li>
|
||||
<li><a class="reference" href="#transform-iterator-requirements" id="id3" name="id3"><tt class="literal"><span class="pre">transform_iterator</span></tt> requirements</a></li>
|
||||
@ -130,7 +130,7 @@ concept that is modeled by the <tt class="literal"><span class="pre">Iterator</s
|
||||
<p>If <tt class="literal"><span class="pre">transform_iterator</span></tt> is a model of Readable Lvalue Iterator then
|
||||
it models the following original iterator concepts depending on what
|
||||
the <tt class="literal"><span class="pre">Iterator</span></tt> argument models.</p>
|
||||
<table border class="table">
|
||||
<table border="1" class="table">
|
||||
<colgroup>
|
||||
<col width="47%" />
|
||||
<col width="53%" />
|
||||
@ -187,17 +187,20 @@ initialized to <tt class="literal"><span class="pre">f</span></tt> and <tt class
|
||||
</tbody>
|
||||
</table>
|
||||
<pre class="literal-block">
|
||||
template<class OtherIterator, class R2, class V2>
|
||||
template<class F2, class I2, class R2, class V2>
|
||||
transform_iterator(
|
||||
transform_iterator<UnaryFunction, OtherIterator, R2, V2> const& t
|
||||
, typename enable_if_convertible<OtherIterator, Iterator>::type* = 0 // exposition
|
||||
transform_iterator<F2, I2, R2, V2> const& t
|
||||
, typename enable_if_convertible<I2, Iterator>::type* = 0 // exposition only
|
||||
, typename enable_if_convertible<F2, UnaryFunction>::type* = 0 // exposition only
|
||||
);
|
||||
</pre>
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
<col class="field-body" />
|
||||
<tbody valign="top">
|
||||
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">An instance of <tt class="literal"><span class="pre">transform_iterator</span></tt> that is a copy of <tt class="literal"><span class="pre">t</span></tt>.</td>
|
||||
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">An instance of <tt class="literal"><span class="pre">transform_iterator</span></tt> with <tt class="literal"><span class="pre">m_f</span></tt>
|
||||
initialized to <tt class="literal"><span class="pre">t.functor()</span></tt> and <tt class="literal"><span class="pre">m_iterator</span></tt> initialized to
|
||||
<tt class="literal"><span class="pre">t.base()</span></tt>.</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">Requires:</th><td class="field-body"><tt class="literal"><span class="pre">OtherIterator</span></tt> is implicitly convertible to <tt class="literal"><span class="pre">Iterator</span></tt>.</td>
|
||||
</tr>
|
||||
|
Binary file not shown.
@ -138,8 +138,8 @@ operations.
|
||||
);
|
||||
|
||||
:Returns: An instance of ``transform_iterator`` with ``m_f``
|
||||
initialized to ``t.functor()`` and ``m_iterator`` initialized to
|
||||
``t.base()``.
|
||||
initialized to ``t.functor()`` and ``m_iterator`` initialized to
|
||||
``t.base()``.
|
||||
:Requires: ``OtherIterator`` is implicitly convertible to ``Iterator``.
|
||||
|
||||
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user