Development

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Fix comment typos in std_valarray.h

    9 answers - 5286 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    The following patch fixes several comment typos in std_valarray.h:
    for mainline?
    Regards,
    Volker
    2005-07-27 Volker Reichelt <reichelt (AT) igpm (DOT) rwth-aachen.de>
    * include/std/std_valarray.h: Fix comment typos.
    24 Nov 2004 04:11:21 -00001.15
    27 Jul 2005 09:23:30 -0000
    @@ -155,7 +155,7 @@ namespace std
    * @brief Assign elements to an array.
    *
    * Assign elements of array to values in @a v. Results are undefined
    - * if @a v is not the same size as this array.
    + * if @a v has not the same size as this array.
    *
    * @param v Valarray to get values from.
    */
    @@ -174,7 +174,7 @@ namespace std
    * @brief Assign elements to an array subset.
    *
    * Assign elements of array to values in @a sa. Results are undefined
    - * if @a sa is not the same size as this array.
    + * if @a sa has not the same size as this array.
    *
    * @param sa Array slice to get values from.
    */
    @@ -184,7 +184,7 @@ namespace std
    * @brief Assign elements to an array subset.
    *
    * Assign elements of array to values in @a ga. Results are undefined
    - * if @a ga is not the same size as this array.
    + * if @a ga has not the same size as this array.
    *
    * @param ga Array slice to get values from.
    */
    @@ -194,7 +194,7 @@ namespace std
    * @brief Assign elements to an array subset.
    *
    * Assign elements of array to values in @a ma. Results are undefined
    - * if @a ma is not the same size as this array.
    + * if @a ma has not the same size as this array.
    *
    * @param ma Array slice to get values from.
    */
    @@ -204,7 +204,7 @@ namespace std
    * @brief Assign elements to an array subset.
    *
    * Assign elements of array to values in @a ia. Results are undefined
    - * if @a ia is not the same size as this array.
    + * if @a ia has not the same size as this array.
    *
    * @param ia Array slice to get values from.
    */
    @@ -231,7 +231,7 @@ namespace std
    * @brief Return an array subset.
    *
    * Returns a new valarray containing the elements of the array
    - * indicated by the slice argument. The new valarray is the size of
    + * indicated by the slice argument. The new valarray has the size of
    * the input slice. @see slice.
    *
    * @param s The source slice.
    @@ -243,7 +243,7 @@ namespace std
    * @brief Return a reference to an array subset.
    *
    * Returns a new valarray containing the elements of the array
    - * indicated by the slice argument. The new valarray is the size of
    + * indicated by the slice argument. The new valarray has the size of
    * the input slice. @see slice.
    *
    * @param s The source slice.
    @@ -266,7 +266,7 @@ namespace std
    * @brief Return a reference to an array subset.
    *
    * Returns a new valarray containing the elements of the array
    - * indicated by the gslice argument. The new valarray is
    + * indicated by the gslice argument. The new valarray has
    * the size of the input gslice. @see gslice.
    *
    * @param s The source gslice.
    @@ -448,8 +448,8 @@ namespace std
    *
    * A new valarray is constructed as a copy of this array with elements
    * in shifted positions. For an element with index i, the new position
    - * is i - n. The new valarray is the same size as the current one.
    - * New elements without a value are set to 0. Elements whos new
    + * is i - n. The new valarray has the same size as the current one.
    + * New elements without a value are set to 0. Elements whose new
    * position is outside the bounds of the array are discarded.
    *
    * Positive arguments shift toward index 0, discarding elements [0, n).
    @@ -465,7 +465,7 @@ namespace std
    *
    * A new valarray is constructed as a copy of this array with elements
    * in shifted positions. For an element with index i, the new position
    - * is (i - n) % size(). The new valarray is the same size as the
    + * is (i - n) % size(). The new valarray has the same size as the
    * current one. Elements that are shifted beyond the array bounds are
    * shifted into the other end of the array. No elements are lost.
    *
    @@ -482,7 +482,7 @@ namespace std
    *
    * Returns a new valarray with elements assigned to the result of
    * applying func to the corresponding element of this array. The new
    - * array is the same size as this one.
    + * array has the same size as this one.
    *
    * @param func Function of Tp returning Tp to apply.
    * @return New valarray with transformed elements.
    @@ -494,7 +494,7 @@ namespace std
    *
    * Returns a new valarray with elements assigned to the result of
    * applying func to the corresponding element of this array. The new
    - * array is the same size as this one.
    + * array has the same size as this one.
    *
    * @param func Function of const Tp& returning Tp to apply.
    * @return New valarray with transformed elements.
    @@ -504,7 +504,7 @@ namespace std
    /**
    * @brief Resize array.
    *
    - * Resize this array to be @a size and set all elements to @a c. All
    + * Resize this array to have @a size and set all elements to @a c. All
    * references and iterators are invalidated.
    *
    * @param size New array size.
  • No.1 | | 389 bytes | |

    Volker Reichelt wrote:

    >The following patch fixes several comment typos in std_valarray.h:
    >

    for mainline?

    While you are at it, please also fix that typo you told me about a few
    days ago ;)

    If nobody of english mother tongue (Jonathan?) objects during the next
    day or so, please go ahead.

    Thanks,
    Paolo.
  • No.2 | | 493 bytes | |

    Volker Reichelt <reichelt (AT) igpm (DOT) rwth-aachen.dewrites:

    | The following patch fixes several comment typos in std_valarray.h:
    |
    | for mainline?

    Yes.

    | * Assign elements of array to values in @a v. Results are undefined
    | - * if @a v is not the same size as this array.
    | + * if @a v has not the same size as this array.

    I guess, that was supposed to read "if @a v is not of the same size"
    but, you version is fine too.
    -- Gaby
  • No.3 | | 1202 bytes | |

    27 Jul, Paolo Carlini wrote:
    Volker Reichelt wrote:

    >>The following patch fixes several comment typos in std_valarray.h:
    >>

    >for mainline?
    >>

    While you are at it, please also fix that typo you told me about a few
    days ago ;)

    This is already in the following hunk (whos -whose).

    @@ -448,8 +448,8 @@ namespace std
    *
    * A new valarray is constructed as a copy of this array with elements
    * in shifted positions. For an element with index i, the new position
    - * is i - n. The new valarray is the same size as the current one.
    - * New elements without a value are set to 0. Elements whos new
    + * is i - n. The new valarray has the same size as the current one.
    + * New elements without a value are set to 0. Elements whose new
    * position is outside the bounds of the array are discarded.
    *
    * Positive arguments shift toward index 0, discarding elements [0, n).

    If nobody of english mother tongue (Jonathan?) objects during the next
    day or so, please go ahead.

    Thanks,
    Paolo.

    Thanks,
    Volker
  • No.4 | | 337 bytes | |

    Volker Reichelt wrote:

    - * if @a v is not the same size as this array.
    + * if @a v has not the same size as this array.

    I am not a native speaker of English, but these changes don't
    look right to me - it should be either "is not of the same
    size" or "does not have the same size".

    My 2p.

    Ranjit.
  • No.5 | | 2169 bytes | |

    Gabriel Dos Reis wrote:

    Volker Reichelt <reichelt (AT) igpm (DOT) rwth-aachen.dewrites:

    | The following patch fixes several comment typos in std_valarray.h:

    | * Assign elements of array to values in @a v. Results are undefined
    | - * if @a v is not the same size as this array.
    | + * if @a v has not the same size as this array.

    I guess, that was supposed to read "if @a v is not of the same size"
    but, you version is fine too.

    Not quite.

    The original is fine, Gaby's version is fine, but Volker's is not good
    English. You never say "A has not B" in English, you say "A does not
    have B."

    So that should be "if @a v does not have the same size as this array."

    It might be technically more accurate as "if the size of @a v is not the
    same as the size of this array" but that's a bit of a mouthful.

    Personally I prefer the original, or "does not have."

    * Returns a new valarray containing the elements of the array
    - * indicated by the slice argument. The new valarray is the size of
    + * indicated by the slice argument. The new valarray has the size of
    * the input slice. @see slice.

    That should probably be "has the same size as the input slice"

    * in shifted positions. For an element with index i, the new position
    - * is (i - n) % size(). The new valarray is the same size as the
    + * is (i - n) % size(). The new valarray has the same size as the
    * current one.

    That's perfect.

    - * Resize this array to be @a size and set all elements to @a c. All
    + * Resize this array to have @a size and set all elements to @a c.

    I don't like the original or the new version much. I would prefer
    "to have size @a size" or "to have length @a size," but I think my first
    choice would be "Resize this array to @a size." That works best if you
    substitute some value for "size" e.g. "Resize to fifteen."

    FWIW the standard talks about lengths, not sizes, e.g.
    "The resulting behavior is undefined if the length of the argument array
    is not equal to the length of the *this array."

    jon
  • No.6 | | 8128 bytes | |

    27 Jul, Jonathan Wakely wrote:
    Gabriel Dos Reis wrote:

    >Volker Reichelt <reichelt (AT) igpm (DOT) rwth-aachen.dewrites:
    >
    >| The following patch fixes several comment typos in std_valarray.h:
    >
    >| * Assign elements of array to values in @a v. Results are undefined
    >| - * if @a v is not the same size as this array.
    >| + * if @a v has not the same size as this array.
    >
    >I guess, that was supposed to read "if @a v is not of the same size"
    >but, you version is fine too.


    Not quite.

    The original is fine, Gaby's version is fine, but Volker's is not good
    English. You never say "A has not B" in English, you say "A does not
    have B."

    course. Stupid me. Sorry!

    So that should be "if @a v does not have the same size as this array."

    It might be technically more accurate as "if the size of @a v is not the
    same as the size of this array" but that's a bit of a mouthful.

    Personally I prefer the original, or "does not have."

    I'll go with "does not have."

    * Returns a new valarray containing the elements of the array
    - * indicated by the slice argument. The new valarray is the size of
    + * indicated by the slice argument. The new valarray has the size of
    * the input slice. @see slice.

    That should probably be "has the same size as the input slice"

    That's better.

    * in shifted positions. For an element with index i, the new position
    - * is (i - n) % size(). The new valarray is the same size as the
    + * is (i - n) % size(). The new valarray has the same size as the
    * current one.

    That's perfect.

    - * Resize this array to be @a size and set all elements to @a c. All
    + * Resize this array to have @a size and set all elements to @a c.

    I don't like the original or the new version much. I would prefer
    "to have size @a size" or "to have length @a size," but I think my first
    choice would be "Resize this array to @a size." That works best if you
    substitute some value for "size" e.g. "Resize to fifteen."

    Indeed.

    FWIW the standard talks about lengths, not sizes, e.g.
    "The resulting behavior is undefined if the length of the argument array
    is not equal to the length of the *this array."

    TH you call size() to get the length :-)

    jon

    Thanks for the thorough review.

    , here's an updated version.
    Is this K for mainline?

    Should I add you, Jon, to the ChangeLog?

    Regards,
    Volker

    2005-07-27 Volker Reichelt <reichelt (AT) igpm (DOT) rwth-aachen.de>

    * include/std/std_valarray.h: Improve grammar in comments.

    24 Nov 2004 04:11:21 -00001.15
    27 Jul 2005 12:07:19 -0000
    @@ -155,7 +155,7 @@ namespace std
    * @brief Assign elements to an array.
    *
    * Assign elements of array to values in @a v. Results are undefined
    - * if @a v is not the same size as this array.
    + * if @a v does not have the same size as this array.
    *
    * @param v Valarray to get values from.
    */
    @@ -174,7 +174,7 @@ namespace std
    * @brief Assign elements to an array subset.
    *
    * Assign elements of array to values in @a sa. Results are undefined
    - * if @a sa is not the same size as this array.
    + * if @a sa does not have the same size as this array.
    *
    * @param sa Array slice to get values from.
    */
    @@ -184,7 +184,7 @@ namespace std
    * @brief Assign elements to an array subset.
    *
    * Assign elements of array to values in @a ga. Results are undefined
    - * if @a ga is not the same size as this array.
    + * if @a ga does not have the same size as this array.
    *
    * @param ga Array slice to get values from.
    */
    @@ -194,7 +194,7 @@ namespace std
    * @brief Assign elements to an array subset.
    *
    * Assign elements of array to values in @a ma. Results are undefined
    - * if @a ma is not the same size as this array.
    + * if @a ma does not have the same size as this array.
    *
    * @param ma Array slice to get values from.
    */
    @@ -204,7 +204,7 @@ namespace std
    * @brief Assign elements to an array subset.
    *
    * Assign elements of array to values in @a ia. Results are undefined
    - * if @a ia is not the same size as this array.
    + * if @a ia does not have the same size as this array.
    *
    * @param ia Array slice to get values from.
    */
    @@ -231,8 +231,8 @@ namespace std
    * @brief Return an array subset.
    *
    * Returns a new valarray containing the elements of the array
    - * indicated by the slice argument. The new valarray is the size of
    - * the input slice. @see slice.
    + * indicated by the slice argument. The new valarray has the same size
    + * as the input slice. @see slice.
    *
    * @param s The source slice.
    * @return New valarray containing elements in @a s.
    @@ -243,8 +243,8 @@ namespace std
    * @brief Return a reference to an array subset.
    *
    * Returns a new valarray containing the elements of the array
    - * indicated by the slice argument. The new valarray is the size of
    - * the input slice. @see slice.
    + * indicated by the slice argument. The new valarray has the same size
    + * as the input slice. @see slice.
    *
    * @param s The source slice.
    * @return New valarray containing elements in @a s.
    @@ -266,8 +266,8 @@ namespace std
    * @brief Return a reference to an array subset.
    *
    * Returns a new valarray containing the elements of the array
    - * indicated by the gslice argument. The new valarray is
    - * the size of the input gslice. @see gslice.
    + * indicated by the gslice argument. The new valarray has
    + * the same size as the input gslice. @see gslice.
    *
    * @param s The source gslice.
    * @return New valarray containing elements in @a s.
    @@ -448,8 +448,8 @@ namespace std
    *
    * A new valarray is constructed as a copy of this array with elements
    * in shifted positions. For an element with index i, the new position
    - * is i - n. The new valarray is the same size as the current one.
    - * New elements without a value are set to 0. Elements whos new
    + * is i - n. The new valarray has the same size as the current one.
    + * New elements without a value are set to 0. Elements whose new
    * position is outside the bounds of the array are discarded.
    *
    * Positive arguments shift toward index 0, discarding elements [0, n).
    @@ -465,7 +465,7 @@ namespace std
    *
    * A new valarray is constructed as a copy of this array with elements
    * in shifted positions. For an element with index i, the new position
    - * is (i - n) % size(). The new valarray is the same size as the
    + * is (i - n) % size(). The new valarray has the same size as the
    * current one. Elements that are shifted beyond the array bounds are
    * shifted into the other end of the array. No elements are lost.
    *
    @@ -482,7 +482,7 @@ namespace std
    *
    * Returns a new valarray with elements assigned to the result of
    * applying func to the corresponding element of this array. The new
    - * array is the same size as this one.
    + * array has the same size as this one.
    *
    * @param func Function of Tp returning Tp to apply.
    * @return New valarray with transformed elements.
    @@ -494,7 +494,7 @@ namespace std
    *
    * Returns a new valarray with elements assigned to the result of
    * applying func to the corresponding element of this array. The new
    - * array is the same size as this one.
    + * array has the same size as this one.
    *
    * @param func Function of const Tp& returning Tp to apply.
    * @return New valarray with transformed elements.
    @@ -504,7 +504,7 @@ namespace std
    /**
    * @brief Resize array.
    *
    - * Resize this array to be @a size and set all elements to @a c. All
    + * Resize this array to @a size and set all elements to @a c. All
    * references and iterators are invalidated.
    *
    * @param size New array size.
  • No.7 | | 1053 bytes | |

    Volker Reichelt wrote:

    27 Jul, Jonathan Wakely wrote:
    The original is fine, Gaby's version is fine, but Volker's is not good
    English. You never say "A has not B" in English, you say "A does not
    have B."

    course. Stupid me. Sorry!

    I don't remember where, but exactly this oddity of English came up on
    another list recently - I think it's fair to say it's English's
    "typename" ;)

    FWIW the standard talks about lengths, not sizes, e.g.
    "The resulting behavior is undefined if the length of the argument array
    is not equal to the length of the *this array."

    TH you call size() to get the length :-)

    Good point!

    Thanks for the thorough review.

    , here's an updated version.

    That all looks good to me.

    Is this K for mainline?

    Should I add you, Jon, to the ChangeLog?

    I don't think I deserve that. I can't help being pedantic about English,
    so feel free to use me for grammar checking :)

    jon
  • No.8 | | 158 bytes | |

    Jonathan Wakely wrote:

    >That all looks good to me.

    Excellent! Thanks a lot to both of you!
    Paolo.
  • No.9 | | 268 bytes | |

    27 Jul, Jonathan Wakely wrote:
    Volker Reichelt wrote:
    [snip]

    >, here's an updated version.

    That all looks good to me.
    [snip]
    jon
    Committed to mainline.
    Regards,
    Volker

Re: Fix comment typos in std_valarray.h


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 7 =
QUESTION ON "Development"

EMSDN.COM