Patchwork [v3] Fix some comments in forward_list wrongly referring to size()

login
register
mail settings
Submitter Paolo Carlini
Date March 14, 2012, 1:18 p.m.
Message ID <4F609AB7.3050206@oracle.com>
Download mbox | patch
Permalink /patch/146614/
State New
Headers show

Comments

Paolo Carlini - March 14, 2012, 1:18 p.m.
Hi,

highly misleading. Committed to mainline (suitable for 4.7.1 too of course)

Thanks,
Paolo.

///////////////////////
2012-03-14  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/forward_list.h: Fix comments.

Patch

Index: include/bits/forward_list.h
===================================================================
--- include/bits/forward_list.h	(revision 185379)
+++ include/bits/forward_list.h	(working copy)
@@ -536,7 +536,8 @@ 
        *  @param  __al  An allocator object.
        *
        *  Create a %forward_list consisting of copies of the elements
-       *  in the initializer_list @a __il.  This is linear in __il.size().
+       *  in the initializer_list @a __il.  This is linear in the number
+       *  of elements of __il.
        */
       forward_list(std::initializer_list<_Tp> __il,
                    const _Alloc& __al = _Alloc())
@@ -585,7 +586,7 @@ 
        *
        *  Replace the contents of the %forward_list with copies of the
        *  elements in the initializer_list @a __il.  This is linear in
-       *  __il.size().
+       *  the number of elements of __il.
        */
       forward_list&
       operator=(std::initializer_list<_Tp> __il)
@@ -603,8 +604,8 @@ 
        *  in the range [@a __first,@a __last).
        *
        *  Note that the assignment completely changes the %forward_list and
-       *  that the resulting %forward_list's size is the same as the number
-       *  of elements assigned.  Old data may be lost.
+       *  that the number of elements of the resulting %forward_list's is the
+       *  same as the number of elements assigned.  Old data is lost.
        */
       template<typename _InputIterator,
 	       typename = std::_RequireInputIter<_InputIterator>>
@@ -620,10 +621,10 @@ 
        *  @param  __n  Number of elements to be assigned.
        *  @param  __val  Value to be assigned.
        *
-       *  This function fills a %forward_list with @a __n copies of the given
-       *  value.  Note that the assignment completely changes the
-       *  %forward_list and that the resulting %forward_list's size is the
-       *  same as the number of elements assigned.  Old data may be lost.
+       *  This function fills a %forward_list with @a __n copies of the
+       *  given value.  Note that the assignment completely changes the
+       *  %forward_list, and that the resulting %forward_list has __n
+       *  elements.  Old data is lost.
        */
       void
       assign(size_type __n, const _Tp& __val)
@@ -742,7 +743,7 @@ 
       { return this->_M_impl._M_head._M_next == 0; }
 
       /**
-       *  Returns the largest possible size of %forward_list.
+       *  Returns the largest possible number of elements of %forward_list.
        */
       size_type
       max_size() const noexcept
@@ -996,9 +997,9 @@ 
        *
        *  This function will %resize the %forward_list to the specified
        *  number of elements.  If the number is smaller than the
-       *  %forward_list's current size the %forward_list is truncated,
-       *  otherwise the %forward_list is extended and the new elements
-       *  are default constructed.
+       *  %forward_list's current number of elements the %forward_list
+       *  is truncated, otherwise the %forward_list is extended and the
+       *  new elements are default constructed.
        */
       void
       resize(size_type __sz);
@@ -1011,9 +1012,9 @@ 
        *
        *  This function will %resize the %forward_list to the specified
        *  number of elements.  If the number is smaller than the
-       *  %forward_list's current size the %forward_list is truncated,
-       *  otherwise the %forward_list is extended and new elements are
-       *  populated with given data.
+       *  %forward_list's current number of elements the %forward_list
+       *  is truncated, otherwise the %forward_list is extended and new
+       *  elements are populated with given data.
        */
       void
       resize(size_type __sz, const value_type& __val);
@@ -1233,11 +1234,11 @@ 
    *  @brief  Forward list equality comparison.
    *  @param  __lx  A %forward_list
    *  @param  __ly  A %forward_list of the same type as @a __lx.
-   *  @return  True iff the size and elements of the forward lists are equal.
+   *  @return  True iff the elements of the forward lists are equal.
    *
-   *  This is an equivalence relation.  It is linear in the size of the
-   *  forward lists.  Deques are considered equivalent if corresponding
-   *  elements compare equal.
+   *  This is an equivalence relation.  It is linear in the number of 
+   *  elements of the forward lists.  Deques are considered equivalent
+   *  if corresponding elements compare equal.
    */
   template<typename _Tp, typename _Alloc>
     bool
@@ -1250,8 +1251,9 @@ 
    *  @param  __ly  A %forward_list of the same type as @a __lx.
    *  @return  True iff @a __lx is lexicographically less than @a __ly.
    *
-   *  This is a total ordering relation.  It is linear in the size of the
-   *  forward lists.  The elements must be comparable with @c <.
+   *  This is a total ordering relation.  It is linear in the number of 
+   *  elements of the forward lists.  The elements must be comparable
+   *  with @c <.
    *
    *  See std::lexicographical_compare() for how the determination is made.
    */