From 5184d64b8023e681369a666ca16e6f55cefd23fe Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 11 Sep 2006 22:27:29 +0000 Subject: [PATCH] Add missing license/copyright [SVN r35070] --- doc/BidirectionalTraversal.html | 334 +++++++++++- doc/BidirectionalTraversal.rst | 4 + doc/ForwardTraversal.html | 330 +++++++++++- doc/ForwardTraversal.rst | 4 + doc/IncrementableIterator.html | 324 +++++++++++- doc/IncrementableIterator.rst | 4 + doc/InteroperableIterator.rst | 4 + doc/LvalueIterator.html | 324 +++++++++++- doc/LvalueIterator.rst | 4 + doc/RandomAccessTraversal.html | 390 ++++++++++++-- doc/RandomAccessTraversal.rst | 4 + doc/ReadableIterator.html | 334 +++++++++++- doc/ReadableIterator.rst | 3 + doc/SinglePassIterator.html | 334 +++++++++++- doc/SinglePassIterator.rst | 4 + doc/SwappableIterator.html | 316 ++++++++++- doc/SwappableIterator.rst | 4 + doc/WritableIterator.html | 316 ++++++++++- doc/WritableIterator.rst | 4 + doc/counting_iterator.html | 336 +++++++++++- doc/counting_iterator.rst | 4 + doc/counting_iterator_abstract.rst | 4 + doc/counting_iterator_eg.rst | 3 + doc/counting_iterator_ref.rst | 4 + doc/facade-and-adaptor.html | 785 ++++++++++++++++++++-------- doc/facade-and-adaptor.rst | 4 + doc/filter_iterator.html | 499 ++++++++++++++---- doc/filter_iterator.rst | 4 + doc/filter_iterator_abstract.rst | 4 + doc/filter_iterator_eg.rst | 3 + doc/func_output_iter_abstract.rst | 4 + doc/func_output_iter_ref.rst | 4 + doc/function_output_iterator.html | 333 +++++++++++- doc/function_output_iterator.rst | 4 + doc/function_output_iterator_eg.rst | 4 + doc/index.html | 332 +++++++++++- doc/index.rst | 4 + doc/indirect_iterator.html | 339 +++++++++++- doc/indirect_iterator.rst | 4 + doc/indirect_iterator_abstract.rst | 4 + doc/indirect_iterator_eg.rst | 4 + doc/indirect_iterator_ref.html | 420 ++++++++++++--- doc/indirect_iterator_ref.rst | 4 + doc/issues.html | 415 ++++++++++++--- doc/iterator_adaptor.html | 361 +++++++++++-- doc/iterator_adaptor.rst | 4 + doc/iterator_adaptor_abstract.rst | 4 + doc/iterator_adaptor_body.rst | 4 + doc/iterator_adaptor_ref.html | 330 +++++++++++- doc/iterator_adaptor_ref.rst | 4 + doc/iterator_archetypes.html | 332 +++++++++++- doc/iterator_archetypes.rst | 4 + doc/iterator_concepts.html | 310 ++++++++++- doc/iterator_concepts.rst | 4 +- doc/iterator_facade.html | 533 +++++++++++++++---- doc/iterator_facade.rst | 4 + doc/iterator_facade_abstract.rst | 4 + doc/iterator_facade_body.rst | 4 + doc/iterator_facade_ref.rst | 4 + doc/iterator_traits.html | 324 +++++++++++- doc/iterator_traits.rst | 4 + doc/make_counting_iterator.rst | 3 + doc/make_filter_iterator.html | 298 ++++++++++- doc/make_filter_iterator.rst | 3 + doc/make_reverse_iterator.rst | 4 + doc/make_transform_iterator.rst | 4 + doc/make_zip_iterator.rst | 4 + doc/new-iter-concepts.html | 300 ++++++++++- doc/new-iter-concepts.rst | 4 + doc/permutation_iter_abstract.rst | 4 + doc/permutation_iterator.html | 360 +++++++++++-- doc/permutation_iterator.rst | 4 + doc/permutation_iterator_body.rst | 4 + doc/permutation_iterator_eg.rst | 4 + doc/permutation_iterator_ref.rst | 4 + doc/pointee.html | 318 ++++++++++- doc/pointee.rst | 4 + doc/ref_problem.html | 353 +++++++++++-- doc/reverse_iterator.html | 340 +++++++++++- doc/reverse_iterator.rst | 4 + doc/reverse_iterator_abstract.rst | 3 + doc/reverse_iterator_eg.rst | 3 + doc/reverse_iterator_ref.rst | 4 + doc/rst2html | 5 +- doc/rst2latex | 3 + doc/transform_iterator.html | 342 +++++++++++- doc/transform_iterator.rst | 4 + doc/transform_iterator_abstract.rst | 4 + doc/transform_iterator_eg.rst | 4 + doc/transform_iterator_ref.rst | 4 + doc/zip_iterator.html | 370 +++++++++++-- doc/zip_iterator.rst | 4 + doc/zip_iterator_abstract.rst | 4 + doc/zip_iterator_eg.rst | 4 + doc/zip_iterator_ref.rst | 3 + 95 files changed, 10347 insertions(+), 1233 deletions(-) diff --git a/doc/BidirectionalTraversal.html b/doc/BidirectionalTraversal.html index 9de555e..5bc8342 100644 --- a/doc/BidirectionalTraversal.html +++ b/doc/BidirectionalTraversal.html @@ -3,48 +3,333 @@ - + Bidirectional Traversal Concept - + -

Bidirectional Traversal Concept

-

A class or built-in type X models the Bidirectional Traversal -concept if, in addition to X meeting the requirements of Forward +

Bidirectional Traversal Concept

+ + + +

A class or built-in type X models the Bidirectional Traversal +concept if, in addition to X meeting the requirements of Forward Traversal Iterator, the following expressions are valid and respect the stated semantics.

- +
- - - - + + - - + + +--(++r) == r. +--r == --s +implies r == +s. &r == &--r. - - + + - + +bidirectional_traversal_tag
Bidirectional Traversal Iterator Requirements (in addition to Forward Traversal +
Bidirectional Traversal Iterator Requirements (in addition to Forward Traversal Iterator)
ExpressionReturn TypeAssertion/Semantics / +
ExpressionReturn TypeAssertion/Semantics / Pre-/Post-condition
--rX&
--rX& pre: there exists -s such that r +s such that r == ++s. post: -s is +s is dereferenceable. ---(++r) == r. ---r == --s -implies r == -s. &r == &--r.
r--convertible to const X&
r--convertible to const X&
 {
   X tmp = r;
@@ -54,18 +339,13 @@ implies r ==
 
iterator_traversal<X>::type
iterator_traversal<X>::type Convertible to -bidirectional_traversal_tag  
- - diff --git a/doc/BidirectionalTraversal.rst b/doc/BidirectionalTraversal.rst index 8655c63..a62b8bd 100755 --- a/doc/BidirectionalTraversal.rst +++ b/doc/BidirectionalTraversal.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + Bidirectional Traversal Concept ............................... diff --git a/doc/ForwardTraversal.html b/doc/ForwardTraversal.html index 80447aa..934aa56 100644 --- a/doc/ForwardTraversal.html +++ b/doc/ForwardTraversal.html @@ -3,60 +3,340 @@ - + Forward Traversal Concept - + -

Forward Traversal Concept

-

A class or built-in type X models the Forward Traversal -concept if, in addition to X meeting the requirements of Default +

Forward Traversal Concept

+ + + +

A class or built-in type X models the Forward Traversal +concept if, in addition to X meeting the requirements of Default Constructible and Single Pass Iterator, the following expressions are valid and respect the stated semantics.

- +
- + - - - + + + - - - + + - - - + + +++r == ++s. - + - + +forward_traversal_tag
Forward Traversal Iterator Requirements (in addition to Default Constructible and Single Pass Iterator)
Forward Traversal Iterator Requirements (in addition to Default Constructible and Single Pass Iterator)
ExpressionReturn TypeAssertion/Note
ExpressionReturn TypeAssertion/Note
X u;X&note: u may have a +
X u;X&note: u may have a singular value.
++rX&r == s and r is +
++rX&r == s and r is dereferenceable implies -++r == ++s.
iterator_traits<X>::difference_type
iterator_traits<X>::difference_type A signed integral type representing the distance between iterators  
iterator_traversal<X>::type
iterator_traversal<X>::type Convertible to -forward_traversal_tag  
- - diff --git a/doc/ForwardTraversal.rst b/doc/ForwardTraversal.rst index c4156d5..80dd9c7 100755 --- a/doc/ForwardTraversal.rst +++ b/doc/ForwardTraversal.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + Forward Traversal Concept ......................... diff --git a/doc/IncrementableIterator.html b/doc/IncrementableIterator.html index 0544d22..c42cfff 100644 --- a/doc/IncrementableIterator.html +++ b/doc/IncrementableIterator.html @@ -3,38 +3,323 @@ - + Incrementable Iterator Concept - + -

Incrementable Iterator Concept

-

A class or built-in type X models the Incrementable Iterator -concept if, in addition to X being Assignable and Copy +

Incrementable Iterator Concept

+ + + +

A class or built-in type X models the Incrementable Iterator +concept if, in addition to X being Assignable and Copy Constructible, the following expressions are valid and respect the stated semantics.

- +
- + - - - + + + - - - + + + - - + + - + +incrementable_traversal_tag
Incrementable Iterator Requirements (in addition to Assignable, Copy Constructible)
Incrementable Iterator Requirements (in addition to Assignable, Copy Constructible)
ExpressionReturn TypeAssertion/Semantics
ExpressionReturn TypeAssertion/Semantics
++rX&&r == &++r
++rX&&r == &++r
r++X
r++X
 {
    X tmp = r;
@@ -44,18 +329,13 @@ stated semantics.

iterator_traversal<X>::type
iterator_traversal<X>::type Convertible to -incrementable_traversal_tag  
- - diff --git a/doc/IncrementableIterator.rst b/doc/IncrementableIterator.rst index f14928e..a1f92ec 100755 --- a/doc/IncrementableIterator.rst +++ b/doc/IncrementableIterator.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + Incrementable Iterator Concept .............................. diff --git a/doc/InteroperableIterator.rst b/doc/InteroperableIterator.rst index 0cb751e..3632ff2 100644 --- a/doc/InteroperableIterator.rst +++ b/doc/InteroperableIterator.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + Interoperable Iterator Concept .............................. diff --git a/doc/LvalueIterator.html b/doc/LvalueIterator.html index 29b3187..6575694 100644 --- a/doc/LvalueIterator.html +++ b/doc/LvalueIterator.html @@ -3,49 +3,329 @@ - + Lvalue Iterator Concept - + -

Lvalue Iterator Concept

+

Lvalue Iterator Concept

+ + +

The Lvalue Iterator concept adds the requirement that the return -type of operator* type be a reference to the value type of the +type of operator* type be a reference to the value type of the iterator.

- +
- + - - - + + + - - - + + +pre: a is +dereferenceable. If a +== b then *a is +equivalent to *b.
Lvalue Iterator Requirements
Lvalue Iterator Requirements
ExpressionReturn TypeNote/Assertion
ExpressionReturn TypeNote/Assertion
*aT&T is cv -iterator_traits<X>::value_type +
*aT&T is cv +iterator_traits<X>::value_type where cv is an optional cv-qualification. -pre: a is -dereferenceable. If a -== b then *a is -equivalent to *b.
- - diff --git a/doc/LvalueIterator.rst b/doc/LvalueIterator.rst index 46c61b1..39c2672 100755 --- a/doc/LvalueIterator.rst +++ b/doc/LvalueIterator.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + Lvalue Iterator Concept ....................... diff --git a/doc/RandomAccessTraversal.html b/doc/RandomAccessTraversal.html index 761ab0d..4dd09ca 100644 --- a/doc/RandomAccessTraversal.html +++ b/doc/RandomAccessTraversal.html @@ -3,19 +3,304 @@ - + Random Access Traversal Concept - + -

Random Access Traversal Concept

-

A class or built-in type X models the Random Access Traversal +

Random Access Traversal Concept

+ + + +

A class or built-in type X models the Random Access Traversal concept if the following expressions are valid and respect the stated -semantics. In the table below, Distance is -iterator_traits<X>::difference_type and n represents a -constant object of type Distance.

- +semantics. In the table below, Distance is +iterator_traits<X>::difference_type and n represents a +constant object of type Distance.

+
@@ -23,18 +308,18 @@ constant object of type Distance - + - - - - + + + - - + + - - - + + - - - + + + - - - + + - - - + + - + - + - + - + - - - - + + + - - - - + + + - - - + + + - - - + + + - + +random_access_traversal_tag
Random Access Traversal Iterator Requirements (in addition to Bidirectional Traversal)
Random Access Traversal Iterator Requirements (in addition to Bidirectional Traversal)
ExpressionReturn TypeOperational SemanticsAssertion/ +
ExpressionReturn TypeOperational SemanticsAssertion/ Precondition
r += nX&
r += nX&
 {
   Distance m = n;
@@ -50,80 +335,75 @@ Precondition
 
 
a + n, n + aX{ X tmp = a; return tmp +
a + n, n + aX{ X tmp = a; return tmp += n; }  
r -= nX&return r += -n
r -= nX&return r += -n  
a - nX{ X tmp = a; return tmp +
a - nX{ X tmp = a; return tmp -= n; }  
b - aDistancea < b ?  distance(a,b) +
b - aDistancea < b ?  distance(a,b) : -distance(b,a) pre: there exists a -value n of -Distance such that -a + n == b. b +value n of +Distance such that +a + n == b. b == a + (b - a).
a[n]
a[n] convertible to T*(a + n)*(a + n) pre: a is a Readable Iterator
a[n] = v
a[n] = v convertible to T*(a + n) = v*(a + n) = v pre: a is a Writable iterator
a < bconvertible to boolb - a > 0< is a total +
a < bconvertible to boolb - a > 0< is a total ordering relation
a > bconvertible to boolb < a> is a total +
a > bconvertible to boolb < a> is a total ordering relation
a >= bconvertible to bool!(a < b)
a >= bconvertible to bool!(a < b)  
a <= bconvertible to bool!(a > b)
a <= bconvertible to bool!(a > b)  
iterator_traversal<X>::type
iterator_traversal<X>::type Convertible to -random_access_traversal_tag   
- - diff --git a/doc/RandomAccessTraversal.rst b/doc/RandomAccessTraversal.rst index 97b0f3d..490faf6 100644 --- a/doc/RandomAccessTraversal.rst +++ b/doc/RandomAccessTraversal.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + Random Access Traversal Concept ............................... diff --git a/doc/ReadableIterator.html b/doc/ReadableIterator.html index df231d3..b6873c4 100644 --- a/doc/ReadableIterator.html +++ b/doc/ReadableIterator.html @@ -3,57 +3,337 @@ - + Readable Iterator Concept - + -

Readable Iterator Concept

-

A class or built-in type X models the Readable Iterator concept -for value type T if, in addition to X being Assignable and +

Readable Iterator Concept

+ + + +

A class or built-in type X models the Readable Iterator concept +for value type T if, in addition to X being Assignable and Copy Constructible, the following expressions are valid and respect -the stated semantics. U is the type of any specified member of -type T.

- +the stated semantics. U is the type of any specified member of +type T.

+
- + - - - + + + - - + + - - - + + - - - + + +
Readable Iterator Requirements (in addition to Assignable and Copy Constructible)
Readable Iterator Requirements (in addition to Assignable and Copy Constructible)
ExpressionReturn TypeNote/Precondition
ExpressionReturn TypeNote/Precondition
iterator_traits<X>::value_typeT
iterator_traits<X>::value_typeT Any non-reference, non-cv-qualified type
*aConvertible to T
-
pre: a is dereferenceable. If a == b then *a
-
is equivalent to *b.
+
*aConvertible to T
+
pre: a is dereferenceable. If a == b then *a
+
is equivalent to *b.
a->mU&pre: pre: (*a).m is well-defined. Equivalent to (*a).m.
a->mU&pre: pre: (*a).m is well-defined. Equivalent to (*a).m.
- - diff --git a/doc/ReadableIterator.rst b/doc/ReadableIterator.rst index d38dad5..27f79f8 100755 --- a/doc/ReadableIterator.rst +++ b/doc/ReadableIterator.rst @@ -1,3 +1,6 @@ +.. Copyright David Abrahams 2006. Distributed under 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) Readable Iterator Concept ......................... diff --git a/doc/SinglePassIterator.html b/doc/SinglePassIterator.html index bd176d8..9a725e7 100644 --- a/doc/SinglePassIterator.html +++ b/doc/SinglePassIterator.html @@ -3,61 +3,341 @@ - + Single Pass Iterator Concept - + -

Single Pass Iterator Concept

-

A class or built-in type X models the Single Pass Iterator +

Single Pass Iterator Concept

+ + + +

A class or built-in type X models the Single Pass Iterator concept if the following expressions are valid and respect the stated semantics.

- +
- - - - + + - - - + + +r is dereferenceable or +r is past-the-end - - - + + - - - + + + - + +single_pass_traversal_tag
Single Pass Iterator Requirements (in addition to Incrementable Iterator and Equality +
Single Pass Iterator Requirements (in addition to Incrementable Iterator and Equality Comparable)
ExpressionReturn TypeAssertion/Semantics / +
ExpressionReturn TypeAssertion/Semantics / Pre-/Post-condition
++rX&pre: r is +
++rX&pre: r is dereferenceable; post: -r is dereferenceable or -r is past-the-end
a == bconvertible to bool== is an equivalence +
a == bconvertible to bool== is an equivalence relation over its domain
a != bconvertible to bool!(a == b)
a != bconvertible to bool!(a == b)
iterator_traversal<X>::type
iterator_traversal<X>::type Convertible to -single_pass_traversal_tag  
- - diff --git a/doc/SinglePassIterator.rst b/doc/SinglePassIterator.rst index 2754d97..eaa50e0 100755 --- a/doc/SinglePassIterator.rst +++ b/doc/SinglePassIterator.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + Single Pass Iterator Concept ............................ diff --git a/doc/SwappableIterator.html b/doc/SwappableIterator.html index 7478e5f..c11b570 100644 --- a/doc/SwappableIterator.html +++ b/doc/SwappableIterator.html @@ -3,47 +3,327 @@ - + Swappable Iterator Concept - + -

Swappable Iterator Concept

-

A class or built-in type X models the Swappable Iterator concept -if, in addition to X being Copy Constructible, the following +

Swappable Iterator Concept

+ + + +

A class or built-in type X models the Swappable Iterator concept +if, in addition to X being Copy Constructible, the following expressions are valid and respect the stated semantics.

- +
- + - - - + + + - - + +
Swappable Iterator Requirements (in addition to Copy Constructible)
Swappable Iterator Requirements (in addition to Copy Constructible)
ExpressionReturn TypePostcondition
ExpressionReturn TypePostcondition
iter_swap(a, b)void
iter_swap(a, b)void the pointed to values are exchanged
-
+
[Note: An iterator that is a model of the Readable and Writable Iterator concepts
is also a model of Swappable Iterator. --end note]
- - diff --git a/doc/SwappableIterator.rst b/doc/SwappableIterator.rst index ec94d32..55554e7 100755 --- a/doc/SwappableIterator.rst +++ b/doc/SwappableIterator.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + Swappable Iterator Concept .......................... diff --git a/doc/WritableIterator.html b/doc/WritableIterator.html index c3676bf..76d621d 100644 --- a/doc/WritableIterator.html +++ b/doc/WritableIterator.html @@ -3,45 +3,325 @@ - + Writable Iterator Concept - + -

Writable Iterator Concept

-

A class or built-in type X models the Writable Iterator concept -if, in addition to X being Copy Constructible, the following +

Writable Iterator Concept

+ + + +

A class or built-in type X models the Writable Iterator concept +if, in addition to X being Copy Constructible, the following expressions are valid and respect the stated semantics. Writable Iterators have an associated set of value types.

- +
- + - - - + + + - + - +value types of X
Writable Iterator Requirements (in addition to Copy Constructible)
Writable Iterator Requirements (in addition to Copy Constructible)
ExpressionReturn TypePrecondition
ExpressionReturn TypePrecondition
*a = o
*a = o  pre: The type of o +pre: The type of o is in the set of -value types of X
- - diff --git a/doc/WritableIterator.rst b/doc/WritableIterator.rst index 7b854cc..49b6e16 100755 --- a/doc/WritableIterator.rst +++ b/doc/WritableIterator.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + Writable Iterator Concept ......................... diff --git a/doc/counting_iterator.html b/doc/counting_iterator.html index 8faa043..63136f0 100644 --- a/doc/counting_iterator.html +++ b/doc/counting_iterator.html @@ -3,13 +3,295 @@ - + Counting Iterator - +
@@ -32,6 +314,9 @@ Railway Operation and Construction Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. + + + @@ -44,6 +329,9 @@ 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.

@@ -51,8 +339,8 @@ are forwarded to the adapted object.

-
-

Table of Contents

+
+

Table of Contents

-
-

counting_iterator synopsis

+
+

counting_iterator synopsis

+ + +
 template <
     class Incrementable
@@ -102,7 +393,7 @@ else if (numeric_limits<Incrementable>::is_specialized)
         random_access_traversal_tag, Incrementable, const Incrementable&)
 else
     return iterator-category(
-         iterator_traversal<Incrementable>::type, 
+         iterator_traversal<Incrementable>::type,
          Incrementable, const Incrementable&)
 
@@ -112,8 +403,8 @@ the cases where std::numeric_limi is true.]
-
-

counting_iterator requirements

+
+

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:

@@ -138,8 +429,8 @@ n = i - j; i < j;
-
-

counting_iterator models

+
+

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. @@ -154,8 +445,8 @@ concepts modeled by Incrementable 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.

@@ -228,6 +519,9 @@ operations.

+ + +
 template <class Incrementable>
 counting_iterator<Incrementable> make_counting_iterator(Incrementable x);
@@ -241,9 +535,12 @@ with current construc
 
 
 
+
+
+
 
-
-

Example

+
+

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 @@ -261,7 +558,7 @@ 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 " +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()), @@ -271,15 +568,10 @@ std::cout << std::endl;

The output is:

 indirectly printing out the numbers from 0 to 7
-0 1 2 3 4 5 6 
+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 191011a..ff7da3c 100644 --- a/doc/counting_iterator.rst +++ b/doc/counting_iterator.rst @@ -1,3 +1,7 @@ +.. Distributed under 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) + +++++++++++++++++++ Counting Iterator +++++++++++++++++++ diff --git a/doc/counting_iterator_abstract.rst b/doc/counting_iterator_abstract.rst index bdb8491..117b94e 100644 --- a/doc/counting_iterator_abstract.rst +++ b/doc/counting_iterator_abstract.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + ``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_eg.rst b/doc/counting_iterator_eg.rst index 5f6b3b3..b64562d 100644 --- a/doc/counting_iterator_eg.rst +++ b/doc/counting_iterator_eg.rst @@ -1,3 +1,6 @@ +.. Copyright David Abrahams 2006. Distributed under 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) Example ....... diff --git a/doc/counting_iterator_ref.rst b/doc/counting_iterator_ref.rst index bc94db7..1c5fd1c 100644 --- a/doc/counting_iterator_ref.rst +++ b/doc/counting_iterator_ref.rst @@ -1,3 +1,7 @@ +.. Copyright David Abrahams 2006. Distributed under 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) + :: template < diff --git a/doc/facade-and-adaptor.html b/doc/facade-and-adaptor.html index 10049b7..d2199e6 100755 --- a/doc/facade-and-adaptor.html +++ b/doc/facade-and-adaptor.html @@ -3,12 +3,294 @@ - + Iterator Facade and Adaptor - +
@@ -32,6 +314,9 @@ committee's library working group. + + + @@ -52,8 +337,8 @@ by adapting other iterators.
-
-

Table of Contents

+
+

Table of Contents

-
-

Motivation

+
+

Motivation

Iterators play an important role in modern C++ programming. The iterator is the central abstraction of the algorithms of the Standard Library, allowing algorithms to be re-used in in a wide variety of @@ -225,16 +510,16 @@ of more specialized adaptors, such as the

-
-

Impact on the Standard

+
+

Impact on the Standard

This proposal is purely an addition to the C++ standard library. However, note that this proposal relies on the proposal for New Iterator Concepts.

-
-

Design

-
-

Iterator Concepts

+
+

Design

+
+

Iterator Concepts

This proposal is formulated in terms of the new iterator concepts as proposed in n1550, since user-defined and especially adapted iterators suffer from the well known categorization problems that are @@ -243,8 +528,8 @@ inherent to the current iterator categories.

is a direct mapping between new and old categories. This proposal could be reformulated using this mapping if n1550 was not accepted.

-
-

Interoperability

+
+

Interoperability

The question of iterator interoperability is poorly addressed in the current standard. There are currently two defect reports that are concerned with interoperability issues.

@@ -263,11 +548,14 @@ reverse iterator types. The proposed new reverse_iterator template fixes the issues raised in 280. It provides the desired interoperability without introducing unwanted overloads.

-
-

Iterator Facade

+
+

Iterator Facade

+ + + - +

While the iterator interface is rich, there is a core subset of the interface that is necessary for all the functionality. We have identified the following core behaviors for iterators:

@@ -307,8 +595,8 @@ iterators, and a separate iterato impossible. -
-

Usage

+
+

Usage

The user of iterator_facade derives his iterator class from a specialization of iterator_facade and passes the derived iterator class as iterator_facade's first template parameter. @@ -331,8 +619,8 @@ requirements.

-Expression -Effects +Expression +Effects @@ -371,8 +659,8 @@ constructor. Finally, if the iterator is to model Forward Traversal Iterator or a more-refined iterator concept, a default constructor is required.

-
-

Iterator Core Access

+
+

Iterator Core Access

iterator_facade and the operator implementations need to be able to access the core member functions in the derived class. Making the core member functions public would expose an implementation detail to @@ -395,7 +683,7 @@ provided, a class that acts as a gateway to the core member functions in the derived iterator class. The author of the derived class only needs to grant friendship to iterator_core_access to make his core member functions available to the library.

- +

iterator_core_access will be typically implemented as an empty class containing only private static member functions which invoke the @@ -405,8 +693,8 @@ standardize the gateway protocol. Note that even if open a safety loophole, as every core member function preserves the invariants of the iterator.

-
-

operator[]

+
+

operator[]

The indexing operator for a generalized iterator presents special challenges. A random access iterator's operator[] is only required to return something convertible to its value_type. @@ -428,8 +716,8 @@ the implementation of her iterator is free to implement an class; it will hide the one supplied by iterator_facade from clients of her iterator.

-
-

operator->

+
+

operator->

The reference type of a readable iterator (and today's input iterator) need not in fact be a reference, so long as it is convertible to the iterator's value_type. When the value_type @@ -450,11 +738,14 @@ Patterns, C++ Report, February 1995, pp. 24-27.

-
-

Iterator Adaptor

+
+

Iterator Adaptor

+ + + - +

The iterator_adaptor class template adapts some Base [3] type to create a new iterator. Instantiations of iterator_adaptor are derived from a corresponding instantiation of iterator_facade @@ -491,8 +782,8 @@ template parameter may not always be identical to the iterator's reference type, and will keep users from making mistakes based on that assumption.

-
-

Specialized Adaptors

+
+

Specialized Adaptors

This proposal also contains several examples of specialized adaptors which were easily implemented using iterator_adaptor:

    @@ -507,7 +798,7 @@ to the underlying values when dereferenced.
  • filter_iterator, which provides a view of an iterator range in which some elements of the underlying range are skipped.
-
    +
    • counting_iterator, which adapts any incrementable type (e.g. integers, iterators) so that incrementing/decrementing the adapted iterator and dereferencing it produces successive values of @@ -525,10 +816,10 @@ and Stanford GraphBase [8], to the BGL interface (which requires C++ Standard compliant iterators).

-
-

Proposed Text

-
-

Header <iterator_helper> synopsis [lib.iterator.helper.synopsis]

+
+

Proposed Text

+
+

Header <iterator_helper> synopsis [lib.iterator.helper.synopsis]

 struct use_default;
 
@@ -593,16 +884,22 @@ template <class UnaryFunction>
 class function_output_iterator;
 
-
-

Iterator facade [lib.iterator.facade]

+
+

Iterator facade [lib.iterator.facade]

+ + +

iterator_facade is a base class template that implements the interface of standard iterators in terms of a few core functions and associated types, to be supplied by a derived iterator class.

-
-

Class template iterator_facade

+
+

Class template iterator_facade

+ + + - +
 template <
     class Derived
@@ -686,12 +983,12 @@ template <class Dr, class V, class TC, class R, class D>
 Derived operator+ (typename Derived::difference_type n,
                    iterator_facade<Dr,V,TC,R,D> const&);
 
-

The iterator_category member of iterator_facade is

+

The iterator_category member of iterator_facade is

 iterator-category(CategoryOrTraversal, value_type, reference)
 

where iterator-category is defined as follows:

-
+
 iterator-category(C,R,V) :=
    if (C is convertible to std::input_iterator_tag
        || C is convertible to std::output_iterator_tag
@@ -738,10 +1035,10 @@ traversal tags would add no information]

The enable_if_interoperable template used above is for exposition purposes. The member operators should only be in an overload set -provided the derived types Dr1 and Dr2 are interoperable, +provided the derived types Dr1 and Dr2 are interoperable, meaning that at least one of the types is convertible to the other. The enable_if_interoperable approach uses SFINAE to take the operators -out of the overload set when the types are not interoperable. +out of the overload set when the types are not interoperable. The operators should behave as-if enable_if_interoperable were defined to be:

@@ -760,8 +1057,8 @@ struct enable_if_interoperable
 {};
 
-
-

iterator_facade Requirements

+
+

iterator_facade Requirements

The following table describes the typical valid expressions on iterator_facade's Derived parameter, depending on the iterator concept(s) it will model. The operations in the first @@ -774,8 +1071,8 @@ object of type X, X, and z is a constant object of a random access traversal iterator type interoperable with X.

-
-

iterator_facade Core Operations

+
+

iterator_facade Core Operations

@@ -784,10 +1081,10 @@ interoperable with X. - - - - + + + @@ -834,8 +1131,8 @@ Iterator
ExpressionReturn TypeAssertion/NoteUsed to implement Iterator +
ExpressionReturn TypeAssertion/NoteUsed to implement Iterator Concept(s)
-
-

iterator_facade operations

+
+

iterator_facade operations

The operations in this section are described in terms of operations on the core interface of Derived which may be inaccessible (i.e. private). The implementation should access these operations @@ -859,14 +1156,14 @@ of type pointer equal

 &static_cast<Derived const*>(this)->dereference()
 
-

Otherwise returns an object of unspecified type such that, +

Otherwise returns an object of unspecified type such that, (*static_cast<Derived const*>(this))->m is equivalent to (w = **static_cast<Derived const*>(this), w.m) for some temporary object w of type value_type.

-

unspecified operator[](difference_type n) const;

+

unspecified operator[](difference_type n) const;

@@ -1007,10 +1304,12 @@ operator ==(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, @@ -1029,10 +1328,12 @@ operator !=(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, @@ -1051,10 +1352,12 @@ operator <(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, @@ -1073,10 +1376,12 @@ operator <=(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, @@ -1095,10 +1400,12 @@ operator >(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs, @@ -1117,16 +1424,18 @@ operator >=(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs,
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-
((Dr1 const&)lhs).equal((Dr2 const&)rhs).
-
Otherwise,
-
((Dr2 const&)rhs).equal((Dr1 const&)lhs).
+
then
+

((Dr1 const&)lhs).equal((Dr2 const&)rhs).

+
+
Otherwise,
+

((Dr2 const&)rhs).equal((Dr1 const&)lhs).

+
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-
!((Dr1 const&)lhs).equal((Dr2 const&)rhs).
-
Otherwise,
-
!((Dr2 const&)rhs).equal((Dr1 const&)lhs).
+
then
+

!((Dr1 const&)lhs).equal((Dr2 const&)rhs).

+
+
Otherwise,
+

!((Dr2 const&)rhs).equal((Dr1 const&)lhs).

+
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-
((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) < 0.
-
Otherwise,
-
((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) > 0.
+
then
+

((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) < 0.

+
+
Otherwise,
+

((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) > 0.

+
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-
((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) <= 0.
-
Otherwise,
-
((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) >= 0.
+
then
+

((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) <= 0.

+
+
Otherwise,
+

((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) >= 0.

+
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-
((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) > 0.
-
Otherwise,
-
((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) < 0.
+
then
+

((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) > 0.

+
+
Otherwise,
+

((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) < 0.

+
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-
((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) >= 0.
-
Otherwise,
-
((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) <= 0.
+
then
+

((Dr1 const&)lhs).distance_to((Dr2 const&)rhs) >= 0.

+
+
Otherwise,
+

((Dr2 const&)rhs).distance_to((Dr1 const&)lhs) <= 0.

+
-
+
 template <class Dr1, class V1, class TC1, class R1, class D1,
           class Dr2, class V2, class TC2, class R2, class D2>
 typename enable_if_interoperable<Dr1,Dr2,difference>::type
@@ -1138,23 +1447,27 @@ operator -(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs,
 
 
 Return Type:

if is_convertible<Dr2,Dr1>::value

-
+
-
then
-
difference shall be -iterator_traits<Dr1>::difference_type.
-
Otherwise
-
difference shall be iterator_traits<Dr2>::difference_type
+
then
+

difference shall be +iterator_traits<Dr1>::difference_type.

+
+
Otherwise
+

difference shall be iterator_traits<Dr2>::difference_type

+
Returns:

if is_convertible<Dr2,Dr1>::value

-
then
-
-((Dr1 const&)lhs).distance_to((Dr2 const&)rhs).
-
Otherwise,
-
((Dr2 const&)rhs).distance_to((Dr1 const&)lhs).
+
then
+

-((Dr1 const&)lhs).distance_to((Dr2 const&)rhs).

+
+
Otherwise,
+

((Dr2 const&)rhs).distance_to((Dr1 const&)lhs).

+
@@ -1162,11 +1475,14 @@ operator -(iterator_facade<Dr1,V1,TC1,R1,D1> const& lhs,
-
-

Iterator adaptor [lib.iterator.adaptor]

+
+

Iterator adaptor [lib.iterator.adaptor]

+ + + - +

Each specialization of the iterator_adaptor class template is derived from a specialization of iterator_facade. The core interface functions expected by iterator_facade are implemented in terms of the @@ -1177,11 +1493,14 @@ Whether the derived class models any of the standard iterator concepts depends on the operations supported by the Base type and which core interface functions of iterator_facade are redefined in the Derived class.

-
-

Class template iterator_adaptor

+
+

Class template iterator_adaptor

+ + + - +
 template <
     class Derived
@@ -1191,7 +1510,7 @@ template <
   , class Reference           = use_default
   , class Difference = use_default
 >
-class iterator_adaptor 
+class iterator_adaptor
   : public iterator_facade<Derived, V', C', R', D'> // see details
 {
     friend class iterator_core_access;
@@ -1204,12 +1523,12 @@ class iterator_adaptor
     typedef iterator_adaptor iterator_adaptor_;
     Base const& base_reference() const;
     Base& base_reference();
- private: // Core iterator interface for iterator_facade.  
+ private: // Core iterator interface for iterator_facade.
     typename iterator_adaptor::reference dereference() const;
 
     template <
     class OtherDerived, class OtherIterator, class V, class C, class R, class D
-    >   
+    >
     bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& x) const;
 
     void advance(typename iterator_adaptor::difference_type n);
@@ -1218,7 +1537,7 @@ class iterator_adaptor
 
     template <
         class OtherDerived, class OtherIterator, class V, class C, class R, class D
-    >   
+    >
     typename iterator_adaptor::difference_type distance_to(
         iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& y) const;
 
@@ -1227,13 +1546,13 @@ class iterator_adaptor
 };
 
-
-

iterator_adaptor requirements

+
+

iterator_adaptor requirements

static_cast<Derived*>(iterator_adaptor*) shall be well-formed. The Base argument shall be Assignable and Copy Constructible.

-
-

iterator_adaptor base class parameters

+
+

iterator_adaptor base class parameters

The V', C', R', and D' parameters of the iterator_facade used as a base class in the summary of iterator_adaptor above are defined as follows:

@@ -1273,8 +1592,8 @@ expression involving ``Derived`` in those concepts' requirements. -->
-
-

iterator_adaptor public operations

+
+

iterator_adaptor public operations

iterator_adaptor();

@@ -1282,7 +1601,7 @@ expression involving ``Derived`` in those concepts' requirements. --> - @@ -1307,8 +1626,8 @@ expression involving ``Derived`` in those concepts' requirements. -->
Requires:The Base type must be Default Constructible.
Returns:An instance of iterator_adaptor with +
Returns:An instance of iterator_adaptor with m_iterator default constructed.
-
-

iterator_adaptor protected member functions

+
+

iterator_adaptor protected member functions

Base const& base_reference() const;

@@ -1328,8 +1647,8 @@ expression involving ``Derived`` in those concepts' requirements. -->
-
-

iterator_adaptor private member functions

+
+

iterator_adaptor private member functions

typename iterator_adaptor::reference dereference() const;

@@ -1342,7 +1661,7 @@ expression involving ``Derived`` in those concepts' requirements. -->
 template <
 class OtherDerived, class OtherIterator, class V, class C, class R, class D
->   
+>
 bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& x) const;
 
@@ -1383,7 +1702,7 @@ bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const
 template <
     class OtherDerived, class OtherIterator, class V, class C, class R, class D
->   
+>
 typename iterator_adaptor::difference_type distance_to(
     iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& y) const;
 
@@ -1397,13 +1716,13 @@ typename iterator_adaptor::difference_type distance_to(
-
-

Specialized adaptors [lib.iterator.special.adaptors]

+
+

Specialized adaptors [lib.iterator.special.adaptors]

The enable_if_convertible<X,Y>::type expression used in this section is for exposition purposes. The converting constructors for specialized adaptors should be only be in an overload set provided that an object of type X is implicitly convertible to an object of -type Y. +type Y. The signatures involving enable_if_convertible should behave as-if enable_if_convertible were defined to be:

@@ -1424,10 +1743,13 @@ of enable_if_convertible
 

[Note: The enable_if_convertible approach uses SFINAE to take the constructor out of the overload set when the types are not -implicitly convertible. +implicitly convertible. ]

-
-

Indirect iterator

+
+

Indirect iterator

+ + +

indirect_iterator adapts an iterator by applying an extra dereference inside of operator*(). For example, this iterator adaptor makes it possible to view a container of pointers @@ -1436,8 +1758,8 @@ iterator adaptor makes it possible to view a container of pointers auxiliary traits, pointee and indirect_reference, to provide support for underlying iterators whose value_type is not an iterator.

-
-

Class template pointee

+
+

Class template pointee

@@ -1480,8 +1802,8 @@ else }
-
-

Class template indirect_reference

+
+

Class template indirect_reference

@@ -1515,8 +1837,11 @@ else std::iterator_traits<Dereferenceable>::reference
-
-

Class template indirect_iterator

+
+

Class template indirect_iterator

+ + +
 template <
     class Iterator
@@ -1573,9 +1898,9 @@ if (Reference is use_default) then
 else
     typedef Reference reference;
 
-if (Value is use_default) then 
+if (Value is use_default) then
     typedef pointee<V>::type* pointer;
-else 
+else
     typedef Value* pointer;
 
 if (Difference is use_default)
@@ -1593,8 +1918,8 @@ else
     ) iterator_category;
 
-
-

indirect_iterator requirements

+
+

indirect_iterator requirements

The expression *v, where v is an object of iterator_traits<Iterator>::value_type, shall be valid expression and convertible to reference. Iterator shall @@ -1607,8 +1932,8 @@ the requirements indicated by ite parameter is not use_default, as implied by the algorithm for deducing the default for the value_type member.]

-
-

indirect_iterator models

+
+

indirect_iterator models

In addition to the concepts indicated by iterator_category and by iterator_traversal<indirect_iterator>::type, a specialization of indirect_iterator models the following @@ -1628,8 +1953,8 @@ expression (where t i indirect_iterator<Y,V2,C2,R2,D2> if and only if X is interoperable with Y.

-
-

indirect_iterator operations

+
+

indirect_iterator operations

In addition to the operations required by the concepts described above, specializations of indirect_iterator provide the following operations.

@@ -1640,7 +1965,7 @@ following operations.

Requires:Iterator must be Default Constructible. -Effects:Constructs an instance of indirect_iterator with +Effects:Constructs an instance of indirect_iterator with a default-constructed m_iterator. @@ -1673,7 +1998,7 @@ indirect_iterator( Requires:Iterator2 is implicitly convertible to Iterator. -Effects:Constructs an instance of indirect_iterator whose +Effects:Constructs an instance of indirect_iterator whose m_iterator subobject is constructed from y.base(). @@ -1720,12 +2045,18 @@ indirect_iterator(
-
-

Reverse iterator

+
+

Reverse iterator

+ + +

The reverse iterator adaptor iterates through the adapted iterator range in the opposite direction.

-
-

Class template reverse_iterator

+
+

Class template reverse_iterator

+ + +
 template <class Iterator>
 class reverse_iterator
@@ -1761,14 +2092,14 @@ Lvalue Iterator, then iterator_ca
 bidirectional_iterator_tag. Otherwise, iterator_category is
 convertible to input_iterator_tag.

-
-

reverse_iterator requirements

+
+

reverse_iterator requirements

Iterator must be a model of Bidirectional Traversal Iterator. The type iterator_traits<Iterator>::reference must be the type of *i, where i is an object of type Iterator.

-
-

reverse_iterator models

+
+

reverse_iterator models

A specialization of reverse_iterator models the same iterator traversal and iterator access concepts modeled by its Iterator argument. In addition, it may model old iterator concepts @@ -1779,8 +2110,8 @@ specified in the following table:

-If I models -then reverse_iterator<I> models +If I models +then reverse_iterator<I> models @@ -1806,8 +2137,8 @@ Random Access Traversal Iterator reverse_iterator<Y> if and only if X is interoperable with Y.

-
-

reverse_iterator operations

+
+

reverse_iterator operations

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

@@ -1818,7 +2149,7 @@ operations.

Requires:Iterator must be Default Constructible. -Effects:Constructs an instance of reverse_iterator with m_iterator +Effects:Constructs an instance of reverse_iterator with m_iterator default constructed. @@ -1846,7 +2177,7 @@ reverse_iterator( Requires:OtherIterator is implicitly convertible to Iterator. -Effects:Constructs instance of reverse_iterator whose +Effects:Constructs instance of reverse_iterator whose m_iterator subobject is constructed from y.base(). @@ -1897,18 +2228,24 @@ return *--tmp;
-
-

Transform iterator

+
+

Transform iterator

+ + +

The transform iterator adapts an iterator by modifying the operator* to apply a function object to the result of dereferencing the iterator and returning the result.

-
-

Class template transform_iterator

+
+

Class template transform_iterator

+ + +
 template <class UnaryFunction,
-          class Iterator, 
-          class Reference = use_default, 
+          class Iterator,
+          class Reference = use_default,
           class Value = use_default>
 class transform_iterator
 {
@@ -1955,8 +2292,8 @@ convertible to forward_iterator_t
 model Readable Lvalue Iterator then iterator_category is
 convertible to input_iterator_tag.

-
-

transform_iterator requirements

+
+

transform_iterator requirements

The type UnaryFunction must be Assignable, Copy Constructible, and the expression f(*i) must be valid where f is an object of type UnaryFunction, i is an object of type Iterator, and @@ -1964,8 +2301,8 @@ where the type of f(*i)result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type.

The argument Iterator shall model Readable Iterator.

-
-

transform_iterator models

+
+

transform_iterator models

The resulting transform_iterator models the most refined of the following that is also modeled by Iterator.

@@ -1986,8 +2323,8 @@ the Iterator argument -If Iterator models -then transform_iterator models +If Iterator models +then transform_iterator models @@ -2011,8 +2348,8 @@ mutable iterator (as defined in the old iterator requirements).

transform_iterator<F2, Y, R2, V2> if and only if X is interoperable with Y.

-
-

transform_iterator operations

+
+

transform_iterator operations

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

@@ -2107,8 +2444,11 @@ initialized to t.functor()
-
-

Filter iterator

+
+

Filter iterator

+ + +

The filter iterator adaptor creates a view of an iterator range in which some elements of the range are skipped. A predicate function object controls which elements are skipped. When the predicate is @@ -2119,12 +2459,12 @@ adaptor to know when to stop so as to avoid going past the end of the underlying range. A filter iterator is therefore constructed with pair of iterators indicating the range of elements in the unfiltered sequence to be traversed.

-
-

Class template filter_iterator

+
+

Class template filter_iterator

- +
 template <class Predicate, class Iterator>
 class filter_iterator
@@ -2157,15 +2497,15 @@ private:
 

If Iterator models Readable Lvalue Iterator and Bidirectional Traversal Iterator then iterator_category is convertible to -std::bidirectional_iterator_tag. +std::bidirectional_iterator_tag. Otherwise, if Iterator models Readable Lvalue Iterator and Forward Traversal Iterator then iterator_category is convertible to -std::forward_iterator_tag. +std::forward_iterator_tag. Otherwise iterator_category is convertible to std::input_iterator_tag.

-
-

filter_iterator requirements

+
+

filter_iterator requirements

The Iterator argument shall meet the requirements of Readable Iterator and Single Pass Iterator or it shall meet the requirements of Input Iterator.

@@ -2175,8 +2515,8 @@ the expression p(x) m iterator_traits<Iterator>::value_type, and where the type of p(x) must be convertible to bool.

-
-

filter_iterator models

+
+

filter_iterator models

The concepts that filter_iterator models are dependent on which concepts the Iterator argument models, as specified in the following tables.

@@ -2186,8 +2526,8 @@ following tables.

-If Iterator models -then filter_iterator models +If Iterator models +then filter_iterator models @@ -2208,8 +2548,8 @@ following tables.

-If Iterator models -then filter_iterator models +If Iterator models +then filter_iterator models @@ -2230,8 +2570,8 @@ following tables.

-If Iterator models -then filter_iterator models +If Iterator models +then filter_iterator models @@ -2249,11 +2589,11 @@ following tables.

-

filter_iterator<P1, X> is interoperable with filter_iterator<P2, Y> +

filter_iterator<P1, X> is interoperable with filter_iterator<P2, Y> if and only if X is interoperable with Y.

-
-

filter_iterator operations

+
+

filter_iterator operations

In addition to those operations required by the concepts that filter_iterator models, filter_iterator provides the following operations.

@@ -2264,7 +2604,7 @@ operations.

Requires:Predicate and Iterator must be Default Constructible. -Effects:Constructs a filter_iterator whose``m_pred``, m_iter, and m_end +Effects:Constructs a filter_iterator whose``m_pred``, m_iter, and m_end members are a default constructed. @@ -2275,7 +2615,7 @@ members are a default constructed. Effects:Constructs a filter_iterator where m_iter is either -the first position in the range [x,end) such that f(*m_iter) == true +the first position in the range [x,end) such that f(*m_iter) == true or else``m_iter == end``. The member m_pred is constructed from f and m_end from end. @@ -2290,7 +2630,7 @@ or else``m_iter == end``. The member Predicate is a class type (not a function pointer). Effects:Constructs a filter_iterator where m_iter is either -the first position in the range [x,end) such that m_pred(*m_iter) == true +the first position in the range [x,end) such that m_pred(*m_iter) == true or else``m_iter == end``. The member m_pred is default constructed. @@ -2363,13 +2703,19 @@ or m_pred(*m_iter)
-
-

Counting iterator

+
+

Counting iterator

+ + +

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.

-
-

Class template counting_iterator

+
+

Class template counting_iterator

+ + +
 template <
     class Incrementable
@@ -2409,7 +2755,7 @@ else if (numeric_limits<Incrementable>::is_specialized)
         random_access_traversal_tag, Incrementable, const Incrementable&)
 else
     return iterator-category(
-         iterator_traversal<Incrementable>::type, 
+         iterator_traversal<Incrementable>::type,
          Incrementable, const Incrementable&)
 
@@ -2419,8 +2765,8 @@ the cases where std::numeric_limi is true.]
-
-

counting_iterator requirements

+
+

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:

@@ -2445,8 +2791,8 @@ n = i - j; i < j;
-
-

counting_iterator models

+
+

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. @@ -2461,8 +2807,8 @@ concepts modeled by Incrementable 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.

@@ -2537,8 +2883,11 @@ operations.

-
-

Function output iterator

+
+

Function output iterator

+ + +

The function output iterator adaptor makes it easier to create custom output iterators. The adaptor takes a unary function and creates a model of Output Iterator. Each item assigned to the output iterator is @@ -2546,11 +2895,14 @@ passed as an argument to the unary function. The motivation for this iterator is that creating a conforming output iterator is non-trivial, particularly because the proper implementation usually requires a proxy object.

-
-

Class template function_output_iterator

+ -