This is the mail archive of the
mailing list for the GCC project.
Re: [patch] Fix comment typos in std_valarray.h
- From: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>, libstdc++ at gcc dot gnu dot org,gcc-patches at gcc dot gnu dot org
- Date: Wed, 27 Jul 2005 12:34:58 +0100
- Subject: Re: [patch] Fix comment typos in std_valarray.h
- References: <200507211110.j6LBAQCZ019718@relay.rwth-aachen.de> <42DF838B.email@example.com> <200507270946.j6R9kUFp005409@relay.rwth-aachen.de> <firstname.lastname@example.org>
Gabriel Dos Reis wrote:
> Volker Reichelt <email@example.com> writes:
> | 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.
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
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.
- * 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."
"It is always the best policy to tell the truth, unless, of course, you
are an exceptionally good liar."
- Jerome K. Jerome