From 189533437f6100fd94fb8ba24943567238aa7afc Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Tue, 27 Jan 2004 04:18:44 +0000 Subject: [PATCH] merged from trunk [SVN r21991] --- doc/GNUmakefile | 237 +--------------- doc/counting_iterator.html | 432 ++++++++++++----------------- doc/counting_iterator.rst | 20 +- doc/counting_iterator_abstract.rst | 7 +- doc/counting_iterator_ref.rst | 152 ++++++---- doc/default.css | 40 ++- 6 files changed, 355 insertions(+), 533 deletions(-) diff --git a/doc/GNUmakefile b/doc/GNUmakefile index a536710..a162267 100755 --- a/doc/GNUmakefile +++ b/doc/GNUmakefile @@ -1,232 +1,11 @@ -# GNUmakefile for postprocessing PDF files -# -# © 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 -CAT = /bin/cat -TOUCH = /bin/touch -ZIP = /usr/bin/zip -# ... TeX & postprocessors -PPOWER4 = ppower4 -PDFLATEX = pdflatex -METAPOST = mpost -FIG2DEV = fig2dev -BIBTEX = bibtex -FOLIAGECUTTER = foliageCutter --verbose -RST2LATEX = rst2latex --documentclass book --documentoptions 10pt,twoside,pdftex # --use-latex-toc -RST2HTML = rst2html +all: + @${ECHO} "/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 = 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 -DEPENDFILE = .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 .depend *.ps TMP-*.pdf *.ftoc\ - ${PRINTZIP} ${SLIDEZIP} ${GENFILE} ${DEPENDFILE} \ - ${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 .depend ${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 - @for t in ${RSTSTEMS} ; do \ - ${ECHO} "Scanning $$t.rst"; \ - ${PERL} -e 'my $$target = shift @ARGV;' -e 'while (<>) { /^\.\. include::\s+(.*)/ && print "$$target: $$1\n";}' $$t.html < $$t.rst >> $@; \ - ${PERL} -e 'my $$target = shift @ARGV;' -e 'while (<>) { /^\.\. include::\s+(.*)/ && print "$$target: $$1\n";}' $$t.tex < $$t.rst >> $@; \ - done - - -# ... include dependency file --include .depend diff --git a/doc/counting_iterator.html b/doc/counting_iterator.html index 15fc046..a098422 100644 --- a/doc/counting_iterator.html +++ b/doc/counting_iterator.html @@ -7,200 +7,9 @@ Counting Iterator - + - +
@@ -218,7 +27,7 @@ ul.auto-toc { Lab, University of Hanover Institute for Transport Railway Operation and Construction Date: -2003-09-14 +2004-01-15 Copyright: Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved @@ -227,92 +36,137 @@ Railway Operation and Construction -abstract: +abstract:

How would you fill up a vector with the numbers zero +through one hundred using std::copy()? The only iterator +operation missing from builtin integer types is an +operator*() that returns the current value of the integer. +The counting iterator adaptor adds this crucial piece of +functionality to whatever type it wraps. One can use the +counting iterator adaptor not only with integer types, but with +any incrementable type.

+

counting_iterator adapts an object by adding an operator* that +returns the current value of the object. All other iterator operations +are forwarded to the adapted object.

+ -

The counting iterator adaptor implements dereference by returning a -reference to the base object. The other operations are implemented by -the base m_iterator, as per the inheritance from -iterator_adaptor.

+
+

counting_iterator synopsis

 template <
     class Incrementable
-  , unsigned Access = use_default_access
-  , class Traversal = use_default
+  , class CategoryOrTraversal = use_default
   , class Difference = use_default
 >
 class counting_iterator
-  : public iterator_adaptor<
-        counting_iterator<Incrementable, Access, Traversal, Difference>
-      , Incrementable
-      , Incrementable
-      , Access
-      , /* see details for traversal category */
-      , Incrementable const&
-      , Incrementable const*
-      , /* distance = Difference or a signed integral type */>
 {
-    friend class iterator_core_access;
- public:
+public:
+    typedef Incrementable value_type;
+    typedef const Incrementable& reference;
+    typedef const Incrementable* pointer;
+    typedef /* see below */ difference_type;
+    typedef /* see below */ iterator_category;
+
     counting_iterator();
     counting_iterator(counting_iterator const& rhs);
-    counting_iterator(Incrementable x);
- private:
-    typename counting_iterator::reference dereference() const
-    {
-        return this->base_reference();
-    }
-  };
+    explicit counting_iterator(Incrementable x);
+    Incrementable const& base() const;
+    reference operator*() const;
+    counting_iterator& operator++();
+    counting_iterator& operator--();
+private:
+    Incrementable m_inc; // exposition
+};
+
+

If the Difference argument is use_default then +difference_type is an unspecified signed integral +type. Otherwise difference_type is Difference.

+

iterator_category is determined according to the following +algorithm:

+
+if (CategoryOrTraversal is not use_default)
+    return CategoryOrTraversal
+else if (numeric_limits<Incrementable>::is_specialized)
+    return iterator-category(
+        random_access_traversal_tag, Incrementable, const Incrementable&)
+else
+    return iterator-category(
+         iterator_traversal<Incrementable>::type, 
+         Incrementable, const Incrementable&)
 
[Note: implementers are encouraged to provide an implementation of
-
distance_to and a difference_type that avoids overflows in -the cases when the Incrementable type is a numeric type.]
+
operator- and a difference_type that avoids overflows in +the cases where std::numeric_limits<Incrementable>::is_specialized +is true.]
+
-

counting_iterator requirements

-

The Incrementable type must be Default Constructible, Copy -Constructible, and Assignable. The default distance is -an implementation defined signed integegral type.

-

The resulting counting_iterator models Readable Lvalue Iterator.

-

Furthermore, if you wish to create a counting iterator that is a Forward -Traversal Iterator, then the following expressions must be valid:

+

counting_iterator requirements

+

The Incrementable argument shall be Copy Constructible and Assignable.

+

If iterator_category is convertible to forward_iterator_tag +or forward_traversal_tag, the following must be well-formed:

 Incrementable i, j;
-++i         // pre-increment
-i == j      // operator equal
+++i;         // pre-increment
+i == j;      // operator equal
 
-

If you wish to create a counting iterator that is a -Bidirectional Traversal Iterator, then pre-decrement is also required:

+

If iterator_category is convertible to +bidirectional_iterator_tag or bidirectional_traversal_tag, +the following expression must also be well-formed:

 --i
 
-

If you wish to create a counting iterator that is a Random Access -Traversal Iterator, then these additional expressions are also -required:

+

If iterator_category is convertible to +random_access_iterator_tag or random_access_traversal_tag, +the following must must also be valid:

 counting_iterator::difference_type n;
-i += n
-n = i - j
-i < j
+i += n;
+n = i - j;
+i < j;
 
+
+

counting_iterator models

+

Specializations of counting_iterator model Readable Lvalue +Iterator. In addition, they model the concepts corresponding to the +iterator tags to which their iterator_category is convertible. +Also, if CategoryOrTraversal is not use_default then +counting_iterator models the concept corresponding to the iterator +tag CategoryOrTraversal. Otherwise, if +numeric_limits<Incrementable>::is_specialized, then +counting_iterator models Random Access Traversal Iterator. +Otherwise, counting_iterator models the same iterator traversal +concepts modeled by Incrementable.

+

counting_iterator<X,C1,D1> is interoperable with +counting_iterator<Y,C2,D2> if and only if X is +interoperable with Y.

+
-

counting_iterator operations

+

counting_iterator operations

+

In addition to the operations required by the concepts modeled by +counting_iterator, counting_iterator provides the following +operations.

counting_iterator();

- + + +
Returns:A default constructed instance of counting_iterator.
Requires:Incrementable is Default Constructible.
Effects:Default construct the member m_inc.
@@ -321,26 +175,110 @@ i < j -Returns:An instance of counting_iterator that is a copy of rhs. +Effects:Construct member m_inc from rhs.m_inc. -

counting_iterator(Incrementable x);

+

explicit counting_iterator(Incrementable x);

- +
Returns:An instance of counting_iterator with its base -object copy constructed from x.
Effects:Construct member m_inc from x.
+

reference operator*() const;

+ +++ + + + +
Returns:m_inc
+

counting_iterator& operator++();

+ +++ + + + + + +
Effects:++m_inc
Returns:*this
+

counting_iterator& operator--();

+ +++ + + + + + +
Effects:--m_inc
Returns:*this
+

Incrementable const& base() const;

+ +++ + + + +
Returns:m_inc
+
+template <class Incrementable>
+counting_iterator<Incrementable> make_counting_iterator(Incrementable x);
+
+ +++ + + + +
Returns:An instance of counting_iterator<Incrementable> +with current constructed from x.
+
+
+

Example

+

This example fills an array with numbers and a second array with +pointers into the first array, using counting_iterator for both +tasks. Finally indirect_iterator is used to print out the numbers +into the first array via indirection through the second array.

+
+int N = 7;
+std::vector<int> numbers;
+typedef std::vector<int>::iterator n_iter;
+std::copy(boost::counting_iterator<int>(0),
+         boost::counting_iterator<int>(N),
+         std::back_inserter(numbers));
+
+std::vector<std::vector<int>::iterator> pointers;
+std::copy(boost::make_counting_iterator(numbers.begin()),
+          boost::make_counting_iterator(numbers.end()),
+          std::back_inserter(pointers));
+
+std::cout << "indirectly printing out the numbers from 0 to " 
+          << N << std::endl;
+std::copy(boost::make_indirect_iterator(pointers.begin()),
+          boost::make_indirect_iterator(pointers.end()),
+          std::ostream_iterator<int>(std::cout, " "));
+std::cout << std::endl;
+
+

The output is:

+
+indirectly printing out the numbers from 0 to 7
+0 1 2 3 4 5 6 
+
+

The source code for this example can be found here.

diff --git a/doc/counting_iterator.rst b/doc/counting_iterator.rst index 25fb3b3..2d2cad9 100644 --- a/doc/counting_iterator.rst +++ b/doc/counting_iterator.rst @@ -14,10 +14,26 @@ .. _`Open Systems Lab`: http://www.osl.iu.edu .. _`Institute for Transport Railway Operation and Construction`: http://www.ive.uni-hannover.de -:abstract: +:abstract: How would you fill up a vector with the numbers zero + through one hundred using ``std::copy()``? The only iterator + operation missing from builtin integer types is an + ``operator*()`` that returns the current value of the integer. + The counting iterator adaptor adds this crucial piece of + functionality to whatever type it wraps. One can use the + counting iterator adaptor not only with integer types, but with + any incrementable type. -.. include:: counting_iterator_abstract.rst + .. include:: counting_iterator_abstract.rst .. contents:: Table of Contents +``counting_iterator`` synopsis +.............................. + .. include:: counting_iterator_ref.rst +.. include:: make_counting_iterator.rst + +.. include:: counting_iterator_eg.rst + +.. _iterator-category: iterator_facade.html#iterator-category +.. |iterator-category| replace:: *iterator-category* diff --git a/doc/counting_iterator_abstract.rst b/doc/counting_iterator_abstract.rst index 2ac2233..bdb8491 100644 --- a/doc/counting_iterator_abstract.rst +++ b/doc/counting_iterator_abstract.rst @@ -1,5 +1,4 @@ -The counting iterator adaptor implements dereference by returning a -reference to the base object. The other operations are implemented by -the base ``m_iterator``, as per the inheritance from -``iterator_adaptor``. +``counting_iterator`` adapts an object by adding an ``operator*`` that +returns the current value of the object. All other iterator operations +are forwarded to the adapted object. diff --git a/doc/counting_iterator_ref.rst b/doc/counting_iterator_ref.rst index f443682..bc94db7 100644 --- a/doc/counting_iterator_ref.rst +++ b/doc/counting_iterator_ref.rst @@ -2,90 +2,144 @@ template < class Incrementable - , unsigned Access = use_default_access - , class Traversal = use_default + , class CategoryOrTraversal = use_default , class Difference = use_default > class counting_iterator - : public iterator_adaptor< - counting_iterator - , Incrementable - , Incrementable - , Access - , /* see details for traversal category */ - , Incrementable const& - , Incrementable const* - , /* distance = Difference or a signed integral type */> { - friend class iterator_core_access; - public: + public: + typedef Incrementable value_type; + typedef const Incrementable& reference; + typedef const Incrementable* pointer; + typedef /* see below */ difference_type; + typedef /* see below */ iterator_category; + counting_iterator(); counting_iterator(counting_iterator const& rhs); - counting_iterator(Incrementable x); - private: - typename counting_iterator::reference dereference() const - { - return this->base_reference(); - } - }; + explicit counting_iterator(Incrementable x); + Incrementable const& base() const; + reference operator*() const; + counting_iterator& operator++(); + counting_iterator& operator--(); + private: + Incrementable m_inc; // exposition + }; +If the ``Difference`` argument is ``use_default`` then +``difference_type`` is an unspecified signed integral +type. Otherwise ``difference_type`` is ``Difference``. + +``iterator_category`` is determined according to the following +algorithm: + +.. parsed-literal:: + + if (CategoryOrTraversal is not use_default) + return CategoryOrTraversal + else if (numeric_limits::is_specialized) + return |iterator-category|_\ ( + random_access_traversal_tag, Incrementable, const Incrementable&) + else + return |iterator-category|_\ ( + iterator_traversal::type, + Incrementable, const Incrementable&) + [*Note:* implementers are encouraged to provide an implementation of - ``distance_to`` and a ``difference_type`` that avoids overflows in - the cases when the ``Incrementable`` type is a numeric type.] + ``operator-`` and a ``difference_type`` that avoids overflows in + the cases where ``std::numeric_limits::is_specialized`` + is true.] ``counting_iterator`` requirements ----------------------------------- +.................................. -The ``Incrementable`` type must be Default Constructible, Copy -Constructible, and Assignable. The default distance is -an implementation defined signed integegral type. +The ``Incrementable`` argument shall be Copy Constructible and Assignable. -The resulting ``counting_iterator`` models Readable Lvalue Iterator. - -Furthermore, if you wish to create a counting iterator that is a Forward -Traversal Iterator, then the following expressions must be valid: -:: +If ``iterator_category`` is convertible to ``forward_iterator_tag`` +or ``forward_traversal_tag``, the following must be well-formed:: Incrementable i, j; - ++i // pre-increment - i == j // operator equal + ++i; // pre-increment + i == j; // operator equal -If you wish to create a counting iterator that is a -Bidirectional Traversal Iterator, then pre-decrement is also required: -:: + +If ``iterator_category`` is convertible to +``bidirectional_iterator_tag`` or ``bidirectional_traversal_tag``, +the following expression must also be well-formed:: --i -If you wish to create a counting iterator that is a Random Access -Traversal Iterator, then these additional expressions are also -required: -:: +If ``iterator_category`` is convertible to +``random_access_iterator_tag`` or ``random_access_traversal_tag``, +the following must must also be valid:: counting_iterator::difference_type n; - i += n - n = i - j - i < j + i += n; + n = i - j; + i < j; +``counting_iterator`` models +............................ + +Specializations of ``counting_iterator`` model Readable Lvalue +Iterator. In addition, they model the concepts corresponding to the +iterator tags to which their ``iterator_category`` is convertible. +Also, if ``CategoryOrTraversal`` is not ``use_default`` then +``counting_iterator`` models the concept corresponding to the iterator +tag ``CategoryOrTraversal``. Otherwise, if +``numeric_limits::is_specialized``, then +``counting_iterator`` models Random Access Traversal Iterator. +Otherwise, ``counting_iterator`` models the same iterator traversal +concepts modeled by ``Incrementable``. + +``counting_iterator`` is interoperable with +``counting_iterator`` if and only if ``X`` is +interoperable with ``Y``. ``counting_iterator`` operations --------------------------------- +................................ + +In addition to the operations required by the concepts modeled by +``counting_iterator``, ``counting_iterator`` provides the following +operations. + ``counting_iterator();`` -:Returns: A default constructed instance of ``counting_iterator``. +:Requires: ``Incrementable`` is Default Constructible. +:Effects: Default construct the member ``m_inc``. ``counting_iterator(counting_iterator const& rhs);`` -:Returns: An instance of ``counting_iterator`` that is a copy of ``rhs``. +:Effects: Construct member ``m_inc`` from ``rhs.m_inc``. -``counting_iterator(Incrementable x);`` +``explicit counting_iterator(Incrementable x);`` -:Returns: An instance of ``counting_iterator`` with its base - object copy constructed from ``x``. +:Effects: Construct member ``m_inc`` from ``x``. + +``reference operator*() const;`` + +:Returns: ``m_inc`` + + +``counting_iterator& operator++();`` + +:Effects: ``++m_inc`` +:Returns: ``*this`` + + +``counting_iterator& operator--();`` + +:Effects: ``--m_inc`` +:Returns: ``*this`` + + +``Incrementable const& base() const;`` + +:Returns: ``m_inc`` diff --git a/doc/default.css b/doc/default.css index 2e1fddb..0e4226a 100644 --- a/doc/default.css +++ b/doc/default.css @@ -29,7 +29,7 @@ div.abstract p.topic-title { text-align: center } div.attention, div.caution, div.danger, div.error, div.hint, -div.important, div.note, div.tip, div.warning { +div.important, div.note, div.tip, div.warning, div.admonition { margin: 2em ; border: medium outset ; padding: 1em } @@ -42,7 +42,8 @@ div.warning p.admonition-title { font-family: sans-serif } div.hint p.admonition-title, div.important p.admonition-title, -div.note p.admonition-title, div.tip p.admonition-title { +div.note p.admonition-title, div.tip p.admonition-title, +div.admonition p.admonition-title { font-weight: bold ; font-family: sans-serif } @@ -61,6 +62,19 @@ div.figure { div.footer, div.header { font-size: smaller } +div.sidebar { + margin-left: 1em ; + border: medium outset ; + padding: 0em 1em ; + background-color: #ffffee ; + width: 40% ; + float: right ; + clear: right } + +div.sidebar p.rubric { + font-family: sans-serif ; + font-size: medium } + div.system-messages { margin: 5em } @@ -105,6 +119,10 @@ ol.lowerroman { ol.upperroman { list-style: upper-roman } +p.attribution { + text-align: right ; + margin-left: 50% } + p.caption { font-style: italic } @@ -115,6 +133,21 @@ p.credits { p.label { white-space: nowrap } +p.rubric { + font-weight: bold ; + font-size: larger ; + color: maroon ; + text-align: center } + +p.sidebar-title { + font-family: sans-serif ; + font-weight: bold ; + font-size: larger } + +p.sidebar-subtitle { + font-family: sans-serif ; + font-weight: bold } + p.topic-title { font-weight: bold } @@ -144,6 +177,9 @@ span.classifier-delimiter { span.interpreted { font-family: sans-serif } +span.option { + white-space: nowrap } + span.option-argument { font-style: italic }