Fixed PDF format as article

Added iterator_traits docs


[SVN r22043]
This commit is contained in:
Dave Abrahams
2004-01-29 05:55:26 +00:00
parent 0122a0c8ec
commit 8cf04e1c7b
30 changed files with 6501 additions and 4569 deletions

View File

@ -1,11 +1,232 @@
# 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 ECHO = /bin/echo
PERL = /usr/bin/perl
PYTHON = python
CAT = /bin/cat
TOUCH = /bin/touch
ZIP = /usr/bin/zip
all: # ... TeX & postprocessors
@${ECHO} "<boost-root>/libs/iterator/doc/GNUmakefile should be replaced by" PPOWER4 = ppower4
@${ECHO} PDFLATEX = pdflatex
@${ECHO} " http://www.boost-consulting.com/writing/GNUmakefile," METAPOST = mpost
@${ECHO} FIG2DEV = fig2dev
@${ECHO} "before proceeding. That file is not included in the Boost" BIBTEX = bibtex
@${ECHO} "distribution because it is licensed under the GPL, which violates" FOLIAGECUTTER = foliageCutter --verbose
@${ECHO} "Boost license requirements." 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.

54
doc/docutils.sty Executable file
View File

@ -0,0 +1,54 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% docutils.sty: A style for docutils latex output %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% o author: Alexander Schmolck (a.schmolck@gmx.net)
%% o created: 2002-07-07 10:50:31+00:40
%% o last modified: $Date: 2004/01/29 05:55:26 $
%% o keywords:
%% o license:
%XXX titlesec
%% XXX geometry
\usepackage{graphicx}
\usepackage{latexsym} % extra symbols
\usepackage{url} % !!!: pay attention when using in other commands!!!
\usepackage{verbatim} % normal verbatim has lenght-limit
\usepackage{enumerate} % easy style choice with e.g: ``\begin{enumerate}[Ex i.]``
\usepackage{hyperref} %href, htarget and hlink XXX: pdfauthor, pdfcreator etc.
\usepackage{xr} %XXX do we need this?
% need this to have ``fboxes`` in ``enviroments``, as well as ``verbatim``s
\usepackage{fancybox}
\usepackage{mdwtab} % better tables and arrays (fixes spacing and adds
% vertical align and multirows (m))
\usepackage{ltxtable} % long and autoscaling tables (use X for autoscaled
% columns)
\newcommand{\transition}{\vspace{2em}\par\hrule{}\par\vspace{2em}}
\newcommand{\classifier}[1]{(\textit{#1})}
\newenvironment{topic}[1]%
{\begin{Sbox}%
\begin{minipage}{.8\textwidth}%
\protect{\large{\textbf{#1}}}\par\vspace{.5em}}%
{\end{minipage}\end{Sbox}\fbox{\TheSbox}\par\vspace{.5em}}
%XXX shadow box for warnings?
\newenvironment{admonition}[1]%
{\begin{center}%
\begin{Sbox}%
\begin{minipage}{.9\textwidth}%
\protect{\textsc{#1}}\par\vspace{.2em}}%
{\end{minipage}\end{Sbox}\fbox{\TheSbox}\par\vspace{.5em}\end{center}}
\newenvironment{doctest}%
{\VerbatimEnvironment
\begin{Verbatim}}%
{\end{Verbatim}}
% {%
% \begin{Sbox}%
% \begin{minipage}{.8\textwidth}%
% \protect{\large{\textsc{#1}}\par\vspace{.5em}}}%
% {\end{minipage}\end{Sbox}\fbox{\TheSbox}\par\vspace{.5em}}
%{\end{minipage}\end{Sbox}\fbox{\TheSbox}}
%% just a piece of example code
% \newcommand{\vitem}%
% {\SaveVerb[{\item[\UseVerb{\MyTemp}]}]{\MyTemp}}

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# 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)
# #
# Generate html, TeX, and PDF versions of all the source files # Generate html, TeX, and PDF versions of all the source files
@ -13,7 +16,7 @@ if 0:
for s in sources: for s in sources:
syscmd('boosthtml %s' % s) syscmd('boosthtml %s' % s)
else: else:
extensions = ('html', 'tex', 'pdf') extensions = ('html', 'pdf')
if len(sys.argv) > 1: if len(sys.argv) > 1:
extensions = sys.argv[1:] extensions = sys.argv[1:]
@ -23,7 +26,7 @@ else:
for s in sources for s in sources
] ]
print 'make -k %s' % ' '.join(all) print 'make %s' % ' '.join(all)
syscmd('make -k %s' % ' '.join(all)) syscmd('make %s' % ' '.join(all))

View File

@ -53,21 +53,21 @@ older Boost Iterator Adaptor Library.</td>
<div class="contents topic" id="table-of-contents"> <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"><a name="table-of-contents"><strong>Table of Contents</strong></a></p>
<ul class="simple"> <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="#new-style-iterators" id="id21" name="id21">New-Style Iterators</a></li>
<li><a class="reference" href="#iterator-facade-and-adaptor" id="id23" name="id23">Iterator Facade and Adaptor</a></li> <li><a class="reference" href="#iterator-facade-and-adaptor" id="id22" name="id22">Iterator Facade and Adaptor</a></li>
<li><a class="reference" href="#specialized-adaptors" id="id24" name="id24">Specialized Adaptors</a></li> <li><a class="reference" href="#specialized-adaptors" id="id23" name="id23">Specialized Adaptors</a></li>
<li><a class="reference" href="#iterator-utilities" id="id25" name="id25">Iterator Utilities</a><ul> <li><a class="reference" href="#iterator-utilities" id="id24" name="id24">Iterator Utilities</a><ul>
<li><a class="reference" href="#traits" id="id26" name="id26">Traits</a></li> <li><a class="reference" href="#traits" id="id25" name="id25">Traits</a></li>
<li><a class="reference" href="#testing-and-concept-checking" id="id27" name="id27">Testing and Concept Checking</a></li> <li><a class="reference" href="#testing-and-concept-checking" id="id26" name="id26">Testing and Concept Checking</a></li>
</ul> </ul>
</li> </li>
<li><a class="reference" href="#upgrading-from-the-old-boost-iterator-adaptor-library" id="id28" name="id28">Upgrading from the old Boost Iterator Adaptor Library</a></li> <li><a class="reference" href="#upgrading-from-the-old-boost-iterator-adaptor-library" id="id27" name="id27">Upgrading from the old Boost Iterator Adaptor Library</a></li>
<li><a class="reference" href="#history" id="id29" name="id29">History</a></li> <li><a class="reference" href="#history" id="id28" name="id28">History</a></li>
</ul> </ul>
</div> </div>
<hr /> <hr />
<div class="section" id="new-style-iterators"> <div class="section" id="new-style-iterators">
<h1><a class="toc-backref" href="#id22" name="new-style-iterators">New-Style Iterators</a></h1> <h1><a class="toc-backref" href="#id21" name="new-style-iterators">New-Style Iterators</a></h1>
<p>The iterator categories defined in C++98 are extremely limiting <p>The iterator categories defined in C++98 are extremely limiting
because they bind together two orthogonal concepts: traversal and because they bind together two orthogonal concepts: traversal and
element access. For example, because a random access iterator is element access. For example, because a random access iterator is
@ -86,7 +86,7 @@ concepts, see our</p>
<a class="reference" href="new-iter-concepts.html">Standard Proposal For New-Style Iterators</a> (<a class="reference" href="new-iter-concepts.pdf">PDF</a>)</blockquote> <a class="reference" href="new-iter-concepts.html">Standard Proposal For New-Style Iterators</a> (<a class="reference" href="new-iter-concepts.pdf">PDF</a>)</blockquote>
</div> </div>
<div class="section" id="iterator-facade-and-adaptor"> <div class="section" id="iterator-facade-and-adaptor">
<h1><a class="toc-backref" href="#id23" name="iterator-facade-and-adaptor">Iterator Facade and Adaptor</a></h1> <h1><a class="toc-backref" href="#id22" name="iterator-facade-and-adaptor">Iterator Facade and Adaptor</a></h1>
<p>Writing standard-conforming iterators is tricky, but the need comes <p>Writing standard-conforming iterators is tricky, but the need comes
up often. In order to ease the implementation of new iterators, up often. In order to ease the implementation of new iterators,
the Boost.Iterator library provides the <tt class="literal"><span class="pre">iterator_facade</span></tt> class template, the Boost.Iterator library provides the <tt class="literal"><span class="pre">iterator_facade</span></tt> class template,
@ -113,7 +113,7 @@ and accepted into the first C++ technical report; see our</p>
<p>for more details.</p> <p>for more details.</p>
</div> </div>
<div class="section" id="specialized-adaptors"> <div class="section" id="specialized-adaptors">
<h1><a class="toc-backref" href="#id24" name="specialized-adaptors">Specialized Adaptors</a></h1> <h1><a class="toc-backref" href="#id23" name="specialized-adaptors">Specialized Adaptors</a></h1>
<p>The iterator library supplies a useful suite of standard-conforming <p>The iterator library supplies a useful suite of standard-conforming
iterator templates based on the Boost <a class="reference" href="#iterator-facade-and-adaptor">iterator facade and adaptor</a>.</p> iterator templates based on the Boost <a class="reference" href="#iterator-facade-and-adaptor">iterator facade and adaptor</a>.</p>
<ul class="simple"> <ul class="simple">
@ -137,9 +137,9 @@ positions of heterogeneous underlying iterators.</li>
</ul> </ul>
</div> </div>
<div class="section" id="iterator-utilities"> <div class="section" id="iterator-utilities">
<h1><a class="toc-backref" href="#id25" name="iterator-utilities">Iterator Utilities</a></h1> <h1><a class="toc-backref" href="#id24" name="iterator-utilities">Iterator Utilities</a></h1>
<div class="section" id="traits"> <div class="section" id="traits">
<h2><a class="toc-backref" href="#id26" name="traits">Traits</a></h2> <h2><a class="toc-backref" href="#id25" name="traits">Traits</a></h2>
<ul class="simple"> <ul class="simple">
<li><a class="reference" href="pointee.html"><tt class="literal"><span class="pre">pointee.hpp</span></tt></a> (<a class="reference" href="pointee.pdf">PDF</a>): Provides the capability to deduce the referent types <li><a class="reference" href="pointee.html"><tt class="literal"><span class="pre">pointee.hpp</span></tt></a> (<a class="reference" href="pointee.pdf">PDF</a>): Provides the capability to deduce the referent types
of pointers, smart pointers and iterators in generic code. Used of pointers, smart pointers and iterators in generic code. Used
@ -147,12 +147,13 @@ in <tt class="literal"><span class="pre">indirect_iterator</span></tt>.</li>
<li><a class="reference" href="iterator_traits.html"><tt class="literal"><span class="pre">iterator_traits.hpp</span></tt></a> (<a class="reference" href="iterator_traits.pdf">PDF</a>): Provides <a class="reference" href="../../mpl/doc/index.html">MPL</a>-compatible metafunctions which <li><a class="reference" href="iterator_traits.html"><tt class="literal"><span class="pre">iterator_traits.hpp</span></tt></a> (<a class="reference" href="iterator_traits.pdf">PDF</a>): Provides <a class="reference" href="../../mpl/doc/index.html">MPL</a>-compatible metafunctions which
retrieve an iterator's traits. Also corrects for the deficiencies retrieve an iterator's traits. Also corrects for the deficiencies
of broken implementations of <tt class="literal"><span class="pre">std::iterator_traits</span></tt>.</li> of broken implementations of <tt class="literal"><span class="pre">std::iterator_traits</span></tt>.</li>
<li><a class="reference" href="interoperable.html"><tt class="literal"><span class="pre">interoperable.hpp</span></tt></a> (<a class="reference" href="interoperable.pdf">PDF</a>): Provides an <a class="reference" href="../../mpl/doc/index.html">MPL</a>-compatible metafunction for
testing iterator interoperability</li>
</ul> </ul>
<!-- * |interoperable|_ (PDF__): Provides an MPL_\ -compatible metafunction for
testing iterator interoperability -->
<!-- comment! __ interoperable.pdf -->
</div> </div>
<div class="section" id="testing-and-concept-checking"> <div class="section" id="testing-and-concept-checking">
<h2><a class="toc-backref" href="#id27" name="testing-and-concept-checking">Testing and Concept Checking</a></h2> <h2><a class="toc-backref" href="#id26" name="testing-and-concept-checking">Testing and Concept Checking</a></h2>
<ul class="simple"> <ul class="simple">
<li><a class="reference" href="iterator_concepts.html"><tt class="literal"><span class="pre">iterator_concepts.hpp</span></tt></a> (<a class="reference" href="iterator_concepts.pdf">PDF</a>): Concept checking classes for the new iterator concepts.</li> <li><a class="reference" href="iterator_concepts.html"><tt class="literal"><span class="pre">iterator_concepts.hpp</span></tt></a> (<a class="reference" href="iterator_concepts.pdf">PDF</a>): Concept checking classes for the new iterator concepts.</li>
<li><a class="reference" href="iterator_archetypes.html"><tt class="literal"><span class="pre">iterator_archetypes.hpp</span></tt></a> (<a class="reference" href="iterator_archetypes.pdf">PDF</a>): Concept archetype classes for the new iterators concepts.</li> <li><a class="reference" href="iterator_archetypes.html"><tt class="literal"><span class="pre">iterator_archetypes.hpp</span></tt></a> (<a class="reference" href="iterator_archetypes.pdf">PDF</a>): Concept archetype classes for the new iterators concepts.</li>
@ -160,7 +161,7 @@ testing iterator interoperability</li>
</div> </div>
</div> </div>
<div class="section" id="upgrading-from-the-old-boost-iterator-adaptor-library"> <div class="section" id="upgrading-from-the-old-boost-iterator-adaptor-library">
<h1><a class="toc-backref" href="#id28" name="upgrading-from-the-old-boost-iterator-adaptor-library">Upgrading from the old Boost Iterator Adaptor Library</a></h1> <h1><a class="toc-backref" href="#id27" name="upgrading-from-the-old-boost-iterator-adaptor-library">Upgrading from the old Boost Iterator Adaptor Library</a></h1>
<a class="target" id="upgrading" name="upgrading"></a><p>If you have been using the old Boost Iterator Adaptor library to <a class="target" id="upgrading" name="upgrading"></a><p>If you have been using the old Boost Iterator Adaptor library to
implement iterators, you probably wrote a <tt class="literal"><span class="pre">Policies</span></tt> class which implement iterators, you probably wrote a <tt class="literal"><span class="pre">Policies</span></tt> class which
captures the core operations of your iterator. In the new library captures the core operations of your iterator. In the new library
@ -170,7 +171,7 @@ you probably wrote a <a class="reference" href="../../../more/generic_programmin
<tt class="literal"><span class="pre">iterator_adaptor</span></tt> specialization you needed; in the new library <tt class="literal"><span class="pre">iterator_adaptor</span></tt> specialization you needed; in the new library
design you don't need a type generator (though may want to keep it design you don't need a type generator (though may want to keep it
around as a compatibility aid for older code) because, due to the around as a compatibility aid for older code) because, due to the
use of the Curiously Recurring Template Pattern (CRTP) <a class="citation-reference" href="#cop95" id="id21" name="id21">[Cop95]</a>, use of the Curiously Recurring Template Pattern (CRTP) <a class="citation-reference" href="#cop95" id="id20" name="id20">[Cop95]</a>,
you can now define the iterator class yourself and acquire you can now define the iterator class yourself and acquire
functionality through inheritance from <tt class="literal"><span class="pre">iterator_facade</span></tt> or functionality through inheritance from <tt class="literal"><span class="pre">iterator_facade</span></tt> or
<tt class="literal"><span class="pre">iterator_adaptor</span></tt>. As a result, you also get much finer control <tt class="literal"><span class="pre">iterator_adaptor</span></tt>. As a result, you also get much finer control
@ -185,7 +186,7 @@ type, <tt class="literal"><span class="pre">transform_iterator</span></tt> will
<tt class="literal"><span class="pre">projection_iterator</span></tt> used to.</p> <tt class="literal"><span class="pre">projection_iterator</span></tt> used to.</p>
</div> </div>
<div class="section" id="history"> <div class="section" id="history">
<h1><a class="toc-backref" href="#id29" name="history">History</a></h1> <h1><a class="toc-backref" href="#id28" name="history">History</a></h1>
<p>In 2000 Dave Abrahams was writing an iterator for a container of <p>In 2000 Dave Abrahams was writing an iterator for a container of
pointers, which would access the pointed-to elements when pointers, which would access the pointed-to elements when
dereferenced. Naturally, being a library writer, he decided to dereferenced. Naturally, being a library writer, he decided to
@ -214,7 +215,7 @@ library you see today.</p>
<colgroup><col class="label" /><col /></colgroup> <colgroup><col class="label" /><col /></colgroup>
<col /> <col />
<tbody valign="top"> <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 <tr><td class="label"><a class="fn-backref" href="#id20" name="cop95">[Cop95]</a></td><td>[Coplien, 1995] Coplien, J., Curiously Recurring Template
Patterns, C++ Report, February 1995, pp. 24-27.</td></tr> Patterns, C++ Report, February 1995, pp. 24-27.</td></tr>
</tbody> </tbody>
</table> </table>

Binary file not shown.

View File

@ -195,7 +195,7 @@ Traits
retrieve an iterator's traits. Also corrects for the deficiencies retrieve an iterator's traits. Also corrects for the deficiencies
of broken implementations of ``std::iterator_traits``. of broken implementations of ``std::iterator_traits``.
* |interoperable|_ (PDF__): Provides an MPL_\ -compatible metafunction for .. * |interoperable|_ (PDF__): Provides an MPL_\ -compatible metafunction for
testing iterator interoperability testing iterator interoperability
.. |pointee| replace:: ``pointee.hpp`` .. |pointee| replace:: ``pointee.hpp``
@ -208,7 +208,7 @@ __ iterator_traits.pdf
.. |interoperable| replace:: ``interoperable.hpp`` .. |interoperable| replace:: ``interoperable.hpp``
.. _interoperable: interoperable.html .. _interoperable: interoperable.html
__ interoperable.pdf .. comment! __ interoperable.pdf
.. _MPL: ../../mpl/doc/index.html .. _MPL: ../../mpl/doc/index.html

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
doc/iterator_concepts.pdf Executable file

Binary file not shown.

Binary file not shown.

120
doc/iterator_traits.html Executable file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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/" />
<title>Iterator Traits</title>
<meta name="author" content="David Abrahams" />
<meta name="organization" content="Boost Consulting" />
<meta name="date" content="2004-01-13" />
<meta name="copyright" content="Copyright David Abrahams 2004. All rights reserved" />
<link rel="stylesheet" href="default.css" type="text/css" />
</head>
<body>
<div class="document" id="iterator-traits">
<h1 class="title">Iterator Traits</h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>David Abrahams</td></tr>
<tr><th class="docinfo-name">Contact:</th>
<td><a class="first last reference" href="mailto:dave&#64;boost-consulting.com">dave&#64;boost-consulting.com</a></td></tr>
<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-01-13</td></tr>
<tr><th class="docinfo-name">Copyright:</th>
<td>Copyright David Abrahams 2004. All rights reserved</td></tr>
</tbody>
</table>
<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">abstract:</th><td class="field-body">Header <tt class="literal"><span class="pre">&lt;boost/iterator/iterator_traits.hpp&gt;</span></tt> provides
the ability to access an iterator's associated types using
MPL-compatible <a class="reference" href="../../mpl/doc/index.html#metafunctions">metafunctions</a>.</td>
</tr>
</tbody>
</table>
<div class="section" id="overview">
<h1><a name="overview">Overview</a></h1>
<p><tt class="literal"><span class="pre">std::iterator_traits</span></tt> provides access to five associated types
of any iterator: its <tt class="literal"><span class="pre">value_type</span></tt>, <tt class="literal"><span class="pre">reference</span></tt>, <tt class="literal"><span class="pre">pointer</span></tt>,
<tt class="literal"><span class="pre">iterator_category</span></tt>, and <tt class="literal"><span class="pre">difference_type</span></tt>. Unfortunately,
such a &quot;multi-valued&quot; traits template can be difficult to use in a
metaprogramming context. <tt class="literal"><span class="pre">&lt;boost/iterator/iterator_traits.hpp&gt;</span></tt>
provides access to these types using a standard <a class="reference" href="../../mpl/doc/index.html#metafunctions">metafunctions</a>.</p>
</div>
<div class="section" id="summary">
<h1><a name="summary">Summary</a></h1>
<p>Header <tt class="literal"><span class="pre">&lt;boost/iterator/iterator_traits.hpp&gt;</span></tt>:</p>
<pre class="literal-block">
template &lt;class Iterator&gt;
struct iterator_value
{
typedef typename
std::iterator_traits&lt;Iterator&gt;::value_type
type;
};
template &lt;class Iterator&gt;
struct iterator_reference
{
typedef typename
std::iterator_traits&lt;Iterator&gt;::reference
type;
};
template &lt;class Iterator&gt;
struct iterator_pointer
{
typedef typename
std::iterator_traits&lt;Iterator&gt;::pointer
type;
};
template &lt;class Iterator&gt;
struct iterator_difference
{
typedef typename
detail::iterator_traits&lt;Iterator&gt;::difference_type
type;
};
template &lt;class Iterator&gt;
struct iterator_category
{
typedef typename
detail::iterator_traits&lt;Iterator&gt;::iterator_category
type;
};
</pre>
</div>
<div class="section" id="broken-compiler-notes">
<h1><a name="broken-compiler-notes">Broken Compiler Notes</a></h1>
<p>Because of workarounds in Boost, you may find that these
<a class="reference" href="../../mpl/doc/index.html#metafunctions">metafunctions</a> actually work better than the facilities provided by
your compiler's standard library.</p>
<p>On compilers that don't support partial specialization, such as
Microsoft Visual C++ 6.0 or 7.0, you may need to manually invoke
<a class="reference" href="../../type_traits/index.html#transformations">BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION</a> on the
<tt class="literal"><span class="pre">value_type</span></tt> of pointers that are passed to these metafunctions.</p>
<p>Because of bugs in the implementation of GCC-2.9x, the name of
<tt class="literal"><span class="pre">iterator_category</span></tt> is changed to <tt class="literal"><span class="pre">iterator_category_</span></tt> on that
compiler. A macro, <tt class="literal"><span class="pre">BOOST_ITERATOR_CATEGORY</span></tt>, that expands to
either <tt class="literal"><span class="pre">iterator_category</span></tt> or <tt class="literal"><span class="pre">iterator_category_</span></tt>, as
appropriate to the platform, is provided for portability.</p>
</div>
</div>
<hr class="footer" />
<div class="footer">
<a class="reference" href="iterator_traits.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>

BIN
doc/iterator_traits.pdf Executable file

Binary file not shown.

94
doc/iterator_traits.rst Executable file
View File

@ -0,0 +1,94 @@
+++++++++++++++++
Iterator Traits
+++++++++++++++++
:Author: David Abrahams
:Contact: dave@boost-consulting.com
:organization: `Boost Consulting`_
:date: $Date$
:copyright: Copyright David Abrahams 2004. All rights reserved
.. _`Boost Consulting`: http://www.boost-consulting.com
:abstract: Header ``<boost/iterator/iterator_traits.hpp>`` provides
the ability to access an iterator's associated types using
MPL-compatible metafunctions_.
.. _metafunctions: ../../mpl/doc/index.html#metafunctions
Overview
========
``std::iterator_traits`` provides access to five associated types
of any iterator: its ``value_type``, ``reference``, ``pointer``,
``iterator_category``, and ``difference_type``. Unfortunately,
such a "multi-valued" traits template can be difficult to use in a
metaprogramming context. ``<boost/iterator/iterator_traits.hpp>``
provides access to these types using a standard metafunctions_.
Summary
=======
Header ``<boost/iterator/iterator_traits.hpp>``::
template <class Iterator>
struct iterator_value
{
typedef typename
std::iterator_traits<Iterator>::value_type
type;
};
template <class Iterator>
struct iterator_reference
{
typedef typename
std::iterator_traits<Iterator>::reference
type;
};
template <class Iterator>
struct iterator_pointer
{
typedef typename
std::iterator_traits<Iterator>::pointer
type;
};
template <class Iterator>
struct iterator_difference
{
typedef typename
detail::iterator_traits<Iterator>::difference_type
type;
};
template <class Iterator>
struct iterator_category
{
typedef typename
detail::iterator_traits<Iterator>::iterator_category
type;
};
Broken Compiler Notes
=====================
Because of workarounds in Boost, you may find that these
metafunctions_ actually work better than the facilities provided by
your compiler's standard library.
On compilers that don't support partial specialization, such as
Microsoft Visual C++ 6.0 or 7.0, you may need to manually invoke
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION_ on the
``value_type`` of pointers that are passed to these metafunctions.
Because of bugs in the implementation of GCC-2.9x, the name of
``iterator_category`` is changed to ``iterator_category_`` on that
compiler. A macro, ``BOOST_ITERATOR_CATEGORY``, that expands to
either ``iterator_category`` or ``iterator_category_``, as
appropriate to the platform, is provided for portability.
.. _BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION: ../../type_traits/index.html#transformations

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -21,7 +21,7 @@
<tr><th class="docinfo-name">Author:</th> <tr><th class="docinfo-name">Author:</th>
<td>David Abrahams</td></tr> <td>David Abrahams</td></tr>
<tr><th class="docinfo-name">Contact:</th> <tr><th class="docinfo-name">Contact:</th>
<td><a class="first reference" href="mailto:dave&#64;boost-consulting.com">dave&#64;boost-consulting.com</a>, <a class="reference" href="mailto:jsiek&#64;osl.iu.edu">jsiek&#64;osl.iu.edu</a>, <a class="last reference" href="mailto:witt&#64;ive.uni-hannover.de">witt&#64;ive.uni-hannover.de</a></td></tr> <td><a class="first last reference" href="mailto:dave&#64;boost-consulting.com">dave&#64;boost-consulting.com</a></td></tr>
<tr><th class="docinfo-name">Organization:</th> <tr><th class="docinfo-name">Organization:</th>
<td><a class="first last reference" href="http://www.boost-consulting.com">Boost Consulting</a></td></tr> <td><a class="first last reference" href="http://www.boost-consulting.com">Boost Consulting</a></td></tr>
<tr><th class="docinfo-name">Date:</th> <tr><th class="docinfo-name">Date:</th>

Binary file not shown.

View File

@ -3,7 +3,7 @@
++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++
:Author: David Abrahams :Author: David Abrahams
:Contact: dave@boost-consulting.com, jsiek@osl.iu.edu, witt@ive.uni-hannover.de :Contact: dave@boost-consulting.com
:organization: `Boost Consulting`_ :organization: `Boost Consulting`_
:date: $Date$ :date: $Date$
:copyright: Copyright David Abrahams 2004. All rights reserved :copyright: Copyright David Abrahams 2004. All rights reserved

Binary file not shown.

4
doc/rst2latex Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
PYTHONPATH="c:/src/docutils/docutils;c:/src/docutils/docutils/extras"
export PYTHONPATH
python c:/src/docutils/docutils/tools/rst2latex.py --documentoptions pdftex --stylesheet=docutils.sty --embed-stylesheet $1 `echo $1 | sed 's/\(.*\)\..*/\1.tex/'`

View File

@ -1,6 +1,6 @@
# This is where we list the ReStructuredText source files that form # Copyright David Abrahams 2004. Use, modification and distribution is
# the book. When you're ready to expose a new chapter, add the # subject to the Boost Software License, Version 1.0. (See accompanying
# filename here and put links in index.rst # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
sources = [ sources = [
'counting_iterator.rst', 'counting_iterator.rst',
@ -17,6 +17,8 @@ sources = [
'reverse_iterator.rst', 'reverse_iterator.rst',
'transform_iterator.rst', 'transform_iterator.rst',
'zip_iterator.rst', 'zip_iterator.rst',
'iterator_archetypes.rst' 'iterator_archetypes.rst',
'iterator_concepts.rst',
'iterator_traits.rst'
] ]

14
doc/syscmd.py Normal file
View File

@ -0,0 +1,14 @@
# 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)
import os
import sys
def syscmd(s):
print 'executing: ', repr(s)
sys.stdout.flush()
err = os.system(s)
if err:
raise SystemError, 'command: %s returned %s' % (
repr(s), err)

Binary file not shown.

View File

@ -7,7 +7,7 @@
<title>Zip Iterator</title> <title>Zip Iterator</title>
<meta name="author" content="David Abrahams, Thomas Becker" /> <meta name="author" content="David Abrahams, Thomas Becker" />
<meta name="organization" content="Boost Consulting, Zephyr Associates, Inc." /> <meta name="organization" content="Boost Consulting, Zephyr Associates, Inc." />
<meta name="date" content="2004-01-19" /> <meta name="date" content="2004-01-27" />
<meta name="copyright" content="Copyright David Abrahams and Thomas Becker 2003. All rights reserved" /> <meta name="copyright" content="Copyright David Abrahams and Thomas Becker 2003. All rights reserved" />
<link rel="stylesheet" href="default.css" type="text/css" /> <link rel="stylesheet" href="default.css" type="text/css" />
</head> </head>
@ -25,7 +25,7 @@
<tr><th class="docinfo-name">Organization:</th> <tr><th class="docinfo-name">Organization:</th>
<td><a class="first reference" href="http://www.boost-consulting.com">Boost Consulting</a>, <a class="last reference" href="http://www.styleadvisor.com">Zephyr Associates, Inc.</a></td></tr> <td><a class="first reference" href="http://www.boost-consulting.com">Boost Consulting</a>, <a class="last reference" href="http://www.styleadvisor.com">Zephyr Associates, Inc.</a></td></tr>
<tr><th class="docinfo-name">Date:</th> <tr><th class="docinfo-name">Date:</th>
<td>2004-01-19</td></tr> <td>2004-01-27</td></tr>
<tr><th class="docinfo-name">Copyright:</th> <tr><th class="docinfo-name">Copyright:</th>
<td>Copyright David Abrahams and Thomas Becker 2003. All rights reserved</td></tr> <td>Copyright David Abrahams and Thomas Becker 2003. All rights reserved</td></tr>
</tbody> </tbody>

Binary file not shown.