diff --git a/doc/facade-and-adaptor.html b/doc/facade-and-adaptor.html index caa0d7f..7d05938 100755 --- a/doc/facade-and-adaptor.html +++ b/doc/facade-and-adaptor.html @@ -130,8 +130,8 @@ by adapting other iterators.
  • Function output iterator
  • @@ -2212,54 +2212,52 @@ proxy object.

    template <class UnaryFunction> class function_output_iterator { public: - typedef iterator_tag< - writable_iterator - , incrementable_traversal_tag - > iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; + typedef std::output_iterator_tag iterator_category; + typedef void value_type; + typedef void difference_type; + typedef void pointer; + typedef void reference; explicit function_output_iterator(const UnaryFunction& f = UnaryFunction()); - struct output_proxy { - output_proxy(UnaryFunction& f); - template <class T> output_proxy& operator=(const T& value); - }; - output_proxy operator*(); + /* implementation defined */ operator*(); function_output_iterator& operator++(); function_output_iterator& operator++(int); +private: + UnaryFunction m_f; // exposition only };

    function_output_iterator requirements

    -

    The UnaryFunction must be Assignable, Copy Constructible, and the -expression f(x) must be valid, where f is an object of type -UnaryFunction and x is an object of a type accepted by f. -The resulting function_output_iterator is a model of the Writable -and Incrementable Iterator concepts.

    +

    The UnaryFunction must be Assignable, Copy Constructible.

    +
    +
    +

    function_output_iterator models

    +

    function_output_iterator is a model of the Writable and +Incrementable Iterator concepts.

    -

    function_output_iterator operations

    +

    function_output_iterator operations

    explicit function_output_iterator(const UnaryFunction& f = UnaryFunction());

    +m_f constructed from f.
    Returns:An instance of function_output_iterator with -f stored as a data member.
    -

    output_proxy operator*();

    +

    /* implementation defined */ operator*();

    - +
    Returns:An instance of output_proxy constructed with -a copy of the unary function f.
    Returns:An object r of implementation defined type +such that if f(t) is a valid expression for +some object t then r = t is a valid expression. +r = t will have the same effect as f(t).
    @@ -2281,32 +2279,6 @@ a copy of the unary function f -
    -
    -

    function_output_iterator::output_proxy operations

    -

    output_proxy(UnaryFunction& f);

    - --- - - - -
    Returns:An instance of output_proxy with f stored as -a data member.
    -

    template <class T> output_proxy& operator=(const T& value);

    - --- - - - -
    Effects:
    -m_f(value); 
    -return *this; 
    -
    -
    diff --git a/doc/function_output_iterator.html b/doc/function_output_iterator.html index f11ac05..1ce6beb 100644 --- a/doc/function_output_iterator.html +++ b/doc/function_output_iterator.html @@ -51,8 +51,8 @@ proxy object.

    Table of Contents

    @@ -60,53 +60,51 @@ proxy object.

    template <class UnaryFunction> class function_output_iterator { public: - typedef iterator_tag< - writable_iterator - , incrementable_traversal_tag - > iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; + typedef std::output_iterator_tag iterator_category; + typedef void value_type; + typedef void difference_type; + typedef void pointer; + typedef void reference; explicit function_output_iterator(const UnaryFunction& f = UnaryFunction()); - struct output_proxy { - output_proxy(UnaryFunction& f); - template <class T> output_proxy& operator=(const T& value); - }; - output_proxy operator*(); + /* implementation defined */ operator*(); function_output_iterator& operator++(); function_output_iterator& operator++(int); +private: + UnaryFunction m_f; // exposition only };

    function_output_iterator requirements

    -

    The UnaryFunction must be Assignable, Copy Constructible, and the -expression f(x) must be valid, where f is an object of type -UnaryFunction and x is an object of a type accepted by f. -The resulting function_output_iterator is a model of the Writable -and Incrementable Iterator concepts.

    +

    The UnaryFunction must be Assignable, Copy Constructible.

    +
    +
    +

    function_output_iterator models

    +

    function_output_iterator is a model of the Writable and +Incrementable Iterator concepts.

    -

    function_output_iterator operations

    +

    function_output_iterator operations

    explicit function_output_iterator(const UnaryFunction& f = UnaryFunction());

    +m_f constructed from f.
    Returns:An instance of function_output_iterator with -f stored as a data member.
    -

    output_proxy operator*();

    +

    /* implementation defined */ operator*();

    - +
    Returns:An instance of output_proxy constructed with -a copy of the unary function f.
    Returns:An object r of implementation defined type +such that if f(t) is a valid expression for +some object t then r = t is a valid expression. +r = t will have the same effect as f(t).
    @@ -129,32 +127,6 @@ a copy of the unary function f
    -
    -

    function_output_iterator::output_proxy operations

    -

    output_proxy(UnaryFunction& f);

    - --- - - - -
    Returns:An instance of output_proxy with f stored as -a data member.
    -

    template <class T> output_proxy& operator=(const T& value);

    - --- - - - -
    Effects:
    -m_f(value); 
    -return *this; 
    -
    -
    -

    Example

    @@ -194,7 +166,7 @@ int main(int, char*[])
     
     
     
    diff --git a/doc/function_output_iterator_ref.rst b/doc/function_output_iterator_ref.rst
    index 25b70a5..ab33a84 100644
    --- a/doc/function_output_iterator_ref.rst
    +++ b/doc/function_output_iterator_ref.rst
    @@ -3,35 +3,36 @@
       template 
       class function_output_iterator {
       public:
    -    typedef iterator_tag<
    -          writable_iterator
    -        , incrementable_traversal_tag
    -    > iterator_category;
    -    typedef void                value_type;
    -    typedef void                difference_type;
    -    typedef void                pointer;
    -    typedef void                reference;
    +    typedef std::output_iterator_tag iterator_category;
    +    typedef void                     value_type;
    +    typedef void                     difference_type;
    +    typedef void                     pointer;
    +    typedef void                     reference;
     
         explicit function_output_iterator(const UnaryFunction& f = UnaryFunction());
     
    -    struct output_proxy {
    -      output_proxy(UnaryFunction& f);
    -      template  output_proxy& operator=(const T& value);
    -    };
    -    output_proxy operator*();
    +    /* implementation defined */ operator*();
         function_output_iterator& operator++();
         function_output_iterator& operator++(int);
    +  private:
    +    UnaryFunction m_f;     // exposition only
       };
     
     
    +
     ``function_output_iterator`` requirements
     .........................................
     
    -The ``UnaryFunction`` must be Assignable, Copy Constructible, and the
    -expression ``f(x)`` must be valid, where ``f`` is an object of type
    -``UnaryFunction`` and ``x`` is an object of a type accepted by ``f``.
    -The resulting ``function_output_iterator`` is a model of the Writable
    -and Incrementable Iterator concepts.
    +The ``UnaryFunction`` must be Assignable, Copy Constructible.  
    +
    +
    +
    +``function_output_iterator`` models
    +...................................
    +
    +``function_output_iterator`` is a model of the Writable and
    +Incrementable Iterator concepts.
    +
     
     
     ``function_output_iterator`` operations
    @@ -40,13 +41,15 @@ and Incrementable Iterator concepts.
     ``explicit function_output_iterator(const UnaryFunction& f = UnaryFunction());``
     
     :Returns: An instance of ``function_output_iterator`` with
    -  ``f`` stored as a data member.
    +  ``m_f`` constructed from ``f``.
     
     
    -``output_proxy operator*();``
    +``/* implementation defined */ operator*();``
     
    -:Returns: An instance of ``output_proxy`` constructed with
    -  a copy of the unary function ``f``.
    +:Returns: An object ``r`` of implementation defined type
    +  such that if ``f(t)`` is a valid expression for
    +  some object ``t`` then ``r = t`` is a valid expression.
    +  ``r = t`` will have the same effect as ``f(t)``.
       
     
     ``function_output_iterator& operator++();``
    @@ -57,21 +60,3 @@ and Incrementable Iterator concepts.
     ``function_output_iterator& operator++(int);``
     
     :Returns: ``*this``
    -
    -
    -``function_output_iterator::output_proxy`` operations
    -.....................................................
    -
    -``output_proxy(UnaryFunction& f);``
    -
    -:Returns: An instance of ``output_proxy`` with ``f`` stored as
    -    a data member.
    -
    -
    -``template  output_proxy& operator=(const T& value);``
    -
    -:Effects: 
    -  ::
    -
    -      m_f(value); 
    -      return *this; 
    diff --git a/doc/iter-issue-list.rst b/doc/iter-issue-list.rst
    index 03351a0..626991d 100644
    --- a/doc/iter-issue-list.rst
    +++ b/doc/iter-issue-list.rst
    @@ -679,10 +679,18 @@ with the iterator_adaptor subobject copy constructed from x." The latter is the
     it does not reach inside the base class for its semantics. So the default constructor shoudl return 
     "An instance of indirect_iterator with a default-constructed iterator_adaptor subobject." 
     
    -:Proposed resolution: Change the effects clause to
    +:Proposed resolution: Change the specification of the default constructor to
     
    -  Effects: Constructs an instance of indirect_iterator with a default
    -  constructed iterator_adaptor subobject.
    +``indirect_iterator();``
    +
    +:Requires: ``Iterator`` must be Default Constructible.
    +:Returns: An instance of ``indirect_iterator`` with 
    +   a default-constructed ``m_iterator``.
    +
    +
    +:Rationale: Inheritance from iterator_adaptor has been removed, so we instead
    +  give the semantics in terms of the (exposition only) member
    +  ``m_iterator``.
     
     
     9.29 indirect_iterator: unclear specification of template constructor 
    @@ -702,14 +710,30 @@ Is that what's meant here?
     constructor like this: the constructor returns "a copy" of the argument without saying what a 
     copy is.) 
     
    -:Proposed resolution: Change the effects clause 
    -  to 
    +:Proposed resolution: Change the specification to
     
    -    Effects: Constructs an instance of indirect_iterator whose
    -    iterator_adaptor subobject is constructed from y.base().
    +::
    +
    +  template <
    +      class Iterator2, class Value2, unsigned Access, class Traversal
    +    , class Reference2, class Difference2
    +  >
    +  indirect_iterator(
    +      indirect_iterator<
    +           Iterator2, Value2, Access, Traversal, Reference2, Difference2
    +      > const& y
    +    , typename enable_if_convertible::type* = 0 // exposition
    +  );
    +
    +:Requires: ``Iterator2`` is implicitly convertible to ``Iterator``.
    +:Returns: An instance of ``indirect_iterator`` whose 
    +    ``m_iterator`` subobject is constructed from ``y.base()``.
    +
    +
    +:Rationale: Inheritance from iterator_adaptor has been removed, so we
    +  instead give the semantics in terms of the (exposition only) member
    +  ``m_iterator``.
     
    -  Note/DWA: isn't the iterator_adaptor base class an
    -  implementation detail?  I'm marking this **Needs Work**
     
     9.30 transform_iterator argument irregularity 
     =============================================
    @@ -742,8 +766,16 @@ and to increment such an object. It's only when you try to assign through a dere
     that f(x) has to work, and then only for the particular function object that the iterator holds and 
     for the particular value that is being assigned. 
     
    -:Proposed resolution:   **Needs work** (Jeremy)  Agree, need to find wording.
    +:Proposed resolution:
    +  Remove the part of the sentence after "and". Remove the use of
    +  ``output_proxy`` and instead specify ``operator*`` in the following way.
     
    +``/* implementation defined */ operator*();``
    +
    +:Returns: An object ``r`` of implementation defined type
    +  such that if ``f(t)`` is a valid expression for
    +  some object ``t`` then ``r = t`` is a valid expression.
    +  ``r = t`` will have the same effect as ``f(t)``.
     
     
     9.32 Should output_proxy really be a named type? 
    @@ -756,7 +788,8 @@ This means someone can store an output_proxy object for later use, whatever that
     constrains output_proxy to hold a copy of the function object, rather than a pointer to the iterator 
     object. Is all this mechanism really necessary? 
     
    -:Proposed resolution:   **Needs work** (Jeremy) Agree, need to find wording.
    +:Proposed resolution:
    +  See issue 9.31.