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.
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.
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.
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.
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.
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.
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.
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:
@@ -454,8 +453,7 @@ Patterns, C++ Report, February 1995, pp. 24-27.
The iterator_adaptor class template adapts some Base3
type to create a new iterator. Instantiations of iterator_adaptor
are derived from a corresponding instantiation of iterator_facade
@@ -603,8 +601,7 @@ and associated types, to be supplied by a derived iterator class.
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
@@ -1184,8 +1180,7 @@ core interface functions of iterator_facad
The iterator_category member is a type convertible to the tags
-corresponding to each standard concept modeled by filter_iterator,
-as described in the models section.
+
If Iterator models Readable Lvalue Iterator and Forward Traversal
+Iterator then iterator_category is convertible to
+std::forward_iterator_tag. Otherwise iterator_category is
+convertible to std::input_iterator_tag.
The Iterator argument shall meet the requirements of Readable
+Iterator and Single Pass Iterator or it shall meet the requirements of
+Input Iterator.
The Predicate argument must be Assignable, Copy Constructible, and
the expression p(x) must be valid where p is an object of type
Predicate, x is an object of type
iterator_traits<Iterator>::value_type, and where the type of
p(x) must be convertible to bool.
-
The Iterator argument shall meet the requirements of Readable
-Iterator and Single Pass Iterator or it shall meet the requirements of
-Input Iterator.
Predicate and Iterator must be Default Constructible.
-
Returns:
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.
@@ -143,7 +151,7 @@ members are a default constructed.
-
Returns:
A filter_iterator where m_iter is either
+
Effects:
Constructs a filter_iterator where m_iter is either
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.
@@ -155,9 +163,10 @@ or else``m_iter == end``. The member m_pre
-
Requires:
Predicate must be Default Constructible.
+
Requires:
Predicate must be Default Constructible and
+Predicate is a class type (not a function pointer).
-
Returns:
A filter_iterator where m_iter is either
+
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
or else``m_iter == end``. The member m_pred is default constructed.
@@ -176,7 +185,7 @@ filter_iterator(
Requires:
OtherIterator is implicitly convertible to Iterator.
-
Returns:
A filter iterator whose members are copied from t.
+
Effects:
Constructs a filter iterator whose members are copied from t.
@@ -198,7 +207,7 @@ filter_iterator(
-
Iteratorbase()const;
+
Iteratorconst&base()const;
@@ -231,10 +240,9 @@ or m_pred(*m_iter)
+
diff --git a/doc/function_output_iterator.html b/doc/function_output_iterator.html
index 5addaa5..be94d79 100644
--- a/doc/function_output_iterator.html
+++ b/doc/function_output_iterator.html
@@ -7,8 +7,8 @@
Function Output Iterator
-
-
+
+
@@ -26,9 +26,9 @@
Lab, University of Hanover Institute for Transport
Railway Operation and Construction
Date:
-
2004-01-13
+
2004-11-01
Copyright:
-
Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved
+
Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003.
The member types of indirect_iterator are defined according to the
-following pseudo-code. We use the abbreviation
-V=iterator_traits<Iterator>::value_type and v is an object of
-type V.:
+
The member types of indirect_iterator are defined according to
+the following pseudo-code, where V is
+iterator_traits<Iterator>::value_type
if (Value is use_default) then
- typedef iterator_traits<V>::value_type value_type;
+ typedef remove_const<pointee<V>::type>::type value_type;
else
typedef remove_const<Value>::type value_type;
if (Reference is use_default) then
- typedef iterator_traits<V>::reference reference;
+ if (Value is use_default) then
+ typedef indirect_reference<V>::type reference;
+ else
+ typedef Value& reference;
else
typedef Reference reference;
-typedef Value* pointer;
+if (Value is use_default) then
+ typedef pointee<V>::type* pointer;
+else
+ typedef Value* pointer;
if (Difference is use_default)
typedef iterator_traits<Iterator>::difference_type difference_type;
else
typedef Difference difference_type;
+
+if (CategoryOrTraversal is use_default)
+ typedef iterator-category (
+ iterator_traversal<Iterator>::type,``reference``,``value_type``
+ ) iterator_category;
+else
+ typedef iterator-category (
+ CategoryOrTraversal,``reference``,``value_type``
+ ) iterator_category;
-
The member indirect_iterator::iterator_category is a type that
-satisfies the requirements of the concepts modeled by the indirect
-iterator as specified in the models section.
The Iterator argument shall meet the requirements of Readable
-Iterator. The CategoryOrTraversal argument shall be one of the
-standard iterator tags or use_default. If CategoryOrTraversal
-is an iterator tag, the template parameter Iterator argument shall
-meet the traversal requirements corresponding to the iterator tag.
-
The expression *v, where v is an object of type
-iterator_traits<Iterator>::value_type, must be a valid expression
-and must be convertible to indirect_iterator::reference. Also,
-there are further requirements on the
-iterator_traits<Iterator>::value_type if the Value parameter
-is not use_default, as implied by the algorithm for deducing the
-default for the value_type member.
+
The expression *v, where v is an object of
+iterator_traits<Iterator>::value_type, shall be valid
+expression and convertible to reference. Iterator shall
+model the traversal concept indicated by iterator_category.
+Value, Reference, and Difference shall be chosen so
+that value_type, reference, and difference_type meet
+the requirements indicated by iterator_category.
+
[Note: there are further requirements on the
+iterator_traits<Iterator>::value_type if the Value
+parameter is not use_default, as implied by the algorithm for
+deducing the default for the value_type member.]
If CategoryOrTraversal is a standard iterator tag,
-indirect_iterator is a model of the iterator concept corresponding
-to the tag, otherwise indirect_iterator satisfies the requirements
-of the most refined standard traversal concept that is satisfied by
-the Iterator argument.
-
indirect_iterator models Readable Iterator. If
-indirect_iterator::reference(*v)=t is a valid expression (where
-t is an object of type indirect_iterator::value_type) then
-indirect_iterator models Writable Iterator. If
-indirect_iterator::reference is a reference then
-indirect_iterator models Lvalue Iterator.
+
In addition to the concepts indicated by iterator_category
+and by iterator_traversal<indirect_iterator>::type, a
+specialization of indirect_iterator models the following
+concepts, Where v is an object of
+iterator_traits<Iterator>::value_type:
+
+
+
Readable Iterator if reference(*v) is convertible to
+value_type.
+
Writable Iterator if reference(*v)=t is a valid
+expression (where t is an object of type
+indirect_iterator::value_type)
+
Lvalue Iterator if reference is a reference type.
+
+
+
indirect_iterator<X,V1,C1,R1,D1> is interoperable with
+indirect_iterator<Y,V2,C2,R2,D2> if and only if X is
+interoperable with Y.
function_output_iterator is a model of the Writable and
Incrementable Iterator concepts.
@@ -2612,7 +2609,7 @@ of any specified member of type T
From the Input Iterator Requirements table, remove:
-
+
@@ -2629,7 +2626,7 @@ of any specified member of type T
Change:
-
+
@@ -2648,7 +2645,7 @@ equivalent to *b
to:
-
+
@@ -2678,7 +2675,7 @@ type of the iterator.
Change:
-
+
@@ -2705,7 +2702,7 @@ cv-qualification
to:
-
+
@@ -2970,7 +2967,7 @@ does not provide the 'b' versions of these functions.
Remove the 'b' versions.
In iterator_facade requirements, remove:
-
+
@@ -2989,7 +2986,7 @@ equivalent.
and remove:
-
+
@@ -3063,7 +3060,7 @@ distance(c, (X)z)?
Removed the 'b' versions (see 9.35) and added the cast.
Change:
-
+
@@ -3085,7 +3082,7 @@ Iterator
to:
-
+
@@ -3154,7 +3151,7 @@ below, x is an object of type
type Y, Distance is
iterator_traits<Y>::difference_type, and n represents a
constant object of type Distance.
-
+
@@ -3195,7 +3192,7 @@ constant object of type Distance
If X and Y both model Random Access Traversal Iterator then
the following additional requirements must be met.
-
+
@@ -3294,7 +3291,7 @@ class iterator_adaptor
-
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
@@ -3404,7 +3401,7 @@ else
After the requirements section, add:
-
indirect_iterator models
+
indirect_iterator models
In addition to the concepts indicated by iterator_category
and by iterator_traversal<indirect_iterator>::type, a
@@ -3569,13 +3566,13 @@ by 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
specified in the following table:
-
+
@@ -3798,7 +3795,7 @@ The value_type is
-
transform_iterator models
+
transform_iterator models
The resulting transform_iterator models the most refined of the
following options that is also modeled by Iterator.
@@ -3817,7 +3814,7 @@ concept that is modeled by the IteratorIf transform_iterator is a model of Readable Lvalue Iterator then
it models the following original iterator concepts depending on what
the Iterator argument models.
-
+
@@ -3946,12 +3943,12 @@ Input Iterator.
After the requirements section, add:
-
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.
-
+
@@ -3970,7 +3967,7 @@ following tables.
-
+
@@ -3992,7 +3989,7 @@ following tables.
-
+
@@ -4287,7 +4284,7 @@ the following must must also be valid:
After the requirements section, add:
-
counting_iterator models
+
counting_iterator models
Specializations of counting_iterator model Readable Lvalue
Iterator. In addition, they model the concepts corresponding to the
@@ -4433,7 +4430,7 @@ object copy constructed from x
c++std-lib-12585:
Readable Iterator Requirements says:
-
+
@@ -4802,7 +4799,7 @@ struct indirect_reference;
-
Class template pointee
+
Class template pointee
@@ -4846,7 +4843,7 @@ else
-
Class template indirect_reference
+
Class template indirect_reference
@@ -4991,7 +4988,7 @@ Traversal Iterator to include Default Constructible.
A class or built-in type X models the Forward Traversal Iterator
concept if the following expressions are valid and respect the stated
semantics.
-
+
@@ -5010,7 +5007,7 @@ concept if, in addition to X m
Default Constructible and Single Pass Iterator, the following
expressions are valid and respect the
stated semantics.
-
+
@@ -5122,7 +5119,7 @@ object of type X, z
is a constant object of a random access traversal iterator type
interoperable with X.
-
+
@@ -5202,7 +5199,7 @@ object of a single pass iterator type interoperable with X.
iterator_facade Core Operations
-
+
diff --git a/doc/iterator_adaptor.html b/doc/iterator_adaptor.html
index d09d4c5..14ca2b1 100644
--- a/doc/iterator_adaptor.html
+++ b/doc/iterator_adaptor.html
@@ -3,12 +3,12 @@
-
+
Iterator Adaptor
-
-
+
+
@@ -26,9 +26,9 @@
Lab, University of Hanover Institute for Transport
Railway Operation and Construction
Date:
-
2004-01-12
+
2004-11-01
Copyright:
-
Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved
+
Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003.
@@ -42,8 +42,7 @@ Railway Operation and Construction
-
+
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
@@ -73,8 +72,7 @@ core interface functions of iterator_facad
The iterator_adaptor class template adapts some Base1
type to create a new iterator. Instantiations of iterator_adaptor
are derived from a corresponding instantiation of iterator_facade
@@ -115,8 +113,7 @@ that assumption.
template <
class Derived
diff --git a/doc/iterator_adaptor.pdf b/doc/iterator_adaptor.pdf
index 1dca935..f2ceb96 100755
Binary files a/doc/iterator_adaptor.pdf and b/doc/iterator_adaptor.pdf differ
diff --git a/doc/iterator_adaptor_ref.html b/doc/iterator_adaptor_ref.html
index 7a9b9b9..b979f74 100755
--- a/doc/iterator_adaptor_ref.html
+++ b/doc/iterator_adaptor_ref.html
@@ -3,33 +3,34 @@
-
+
+
-
+
template <
class Derived
, class Base
- , class Value = use_default
- , class CategoryOrTraversal = use_default
- , class Reference = use_default
+ , class Value = use_default
+ , class CategoryOrTraversal = use_default
+ , class Reference = use_default
, class Difference = use_default
>
class iterator_adaptor
- : public iterator_facade<Derived, V, C, R, D> // see details
+ : public iterator_facade<Derived, V', C', R', D'> // see details
{
friend class iterator_core_access;
public:
iterator_adaptor();
explicit iterator_adaptor(Base iter);
- Base base() const;
+ Base const& base() const;
protected:
+ typedef iterator_adaptor iterator_adaptor_;
Base const& base_reference() const;
Base& base_reference();
private: // Core iterator interface for iterator_facade.
@@ -54,23 +55,28 @@ class iterator_adaptor
Base m_iterator; // exposition only
};
The V, C, R, and D parameters of the iterator_facade
+
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:
-V = if (Value is use_default)
+V' = if (Value is use_default)
return iterator_traits<Base>::value_type
else
return Value
-C = if (CategoryOrTraversal is use_default)
+C' = if (CategoryOrTraversal is use_default)
return iterator_traversal<Base>::type
else
return CategoryOrTraversal
-R = if (Reference is use_default)
+R' = if (Reference is use_default)
if (Value is use_default)
return iterator_traits<Base>::reference
else
@@ -78,23 +84,22 @@ above are defined as follows:
else
return Reference
-D = if (Difference is use_default)
+D' = if (Difference is use_default)
return iterator_traits<Base>::difference_type
else
return Difference
The Derived template parameter must be a publicly derived from
-iterator_adaptor. In order for Derived to model the
-iterator concepts corresponding to
-iterator_traits<Derived>::iterator_category, the expressions
-involving m_iterator in the specifications of those private
-member functions of iterator_adaptor that may be called by
-iterator_facade<Derived,V,C,R,D>
-in evaluating any valid expression involving Derived
-in those concepts' requirements.
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:
@@ -272,8 +271,7 @@ Patterns, C++ Report, February 1995, pp. 24-27.
An instance of filter_iterator<Predicate,Iterator>
-where m_iter is either the first position in the range [x,end) such that
-f(*this->base())==true or else m_iter==end.
-The member m_pred is constructed from f and m_end from end.
+
Returns:
filter_iterator<Predicate,Iterator>(f, x, end)
@@ -33,20 +31,14 @@ make_filter_iterator(Iterator x, Iterator end = Iterator());
-
Returns:
An instance of filter_iterator<Predicate,Iterator>
-where m_iter is either the first position in the range [x,end)
-such that f(*this->base())==true, where f is a default
-constructed Predicate, or else m_iter==end.
-The member m_pred is default constructed and m_end
-is constructed from end.
This is a revised version of n1550=03-0133, which was
accepted for Technical Report 1 by the C++ standard
committee's library working group. This proposal is a
@@ -33,7 +33,7 @@ revision of paper Copyright:
Copyright David Abrahams, Jeremy Siek, and Thomas Witt
-2003. All rights reserved