Commit a26b6b94 by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/21035 (Documentation for std::basic_string::compare() incorrect)

2005-04-25  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/21035
	* include/bits/basic_string.h (compare): Adjust the documentation
	to match the implementation and the standard.

From-SVN: r98708
parent 9469878c
2005-04-25 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/21035
* include/bits/basic_string.h (compare): Adjust the documentation
to match the implementation and the standard.
2005-04-24 Paolo Carlini <pcarlini@suse.de> 2005-04-24 Paolo Carlini <pcarlini@suse.de>
* docs/html/ext/lwg-active.html, lwg-defects.html: Import Revision 35. * docs/html/ext/lwg-active.html, lwg-defects.html: Import Revision 35.
......
...@@ -1905,9 +1905,11 @@ namespace std ...@@ -1905,9 +1905,11 @@ namespace std
* *
* Returns an integer < 0 if this string is ordered before @a str, 0 if * Returns an integer < 0 if this string is ordered before @a str, 0 if
* their values are equivalent, or > 0 if this string is ordered after * their values are equivalent, or > 0 if this string is ordered after
* @a str. If the lengths of @a str and this string are different, the * @a str. Determines the effective length rlen of the strings to
* shorter one is ordered first. If they are the same, returns the * compare as the smallest of size() and str.size(). The function
* result of traits::compare(data(),str.data(),size()); * then compares the two strings by calling traits::compare(data(),
* str.data(),rlen). If the result of the comparison is nonzero returns
* it, otherwise the shorter one is ordered first.
*/ */
int int
compare(const basic_string& __str) const compare(const basic_string& __str) const
...@@ -1932,10 +1934,12 @@ namespace std ...@@ -1932,10 +1934,12 @@ namespace std
* Form the substring of this string from the @a n characters starting * Form the substring of this string from the @a n characters starting
* at @a pos. Returns an integer < 0 if the substring is ordered * at @a pos. Returns an integer < 0 if the substring is ordered
* before @a str, 0 if their values are equivalent, or > 0 if the * before @a str, 0 if their values are equivalent, or > 0 if the
* substring is ordered after @a str. If the lengths @a of str and the * substring is ordered after @a str. Determines the effective length
* substring are different, the shorter one is ordered first. If they * rlen of the strings to compare as the smallest of the length of the
* are the same, returns the result of * substring and @a str.size(). The function then compares the two
* traits::compare(substring.data(),str.data(),size()); * strings by calling traits::compare(substring.data(),str.data(),rlen).
* If the result of the comparison is nonzero returns it, otherwise the
* shorter one is ordered first.
*/ */
int int
compare(size_type __pos, size_type __n, const basic_string& __str) const; compare(size_type __pos, size_type __n, const basic_string& __str) const;
...@@ -1954,10 +1958,12 @@ namespace std ...@@ -1954,10 +1958,12 @@ namespace std
* starting at @a pos2. Returns an integer < 0 if this substring is * starting at @a pos2. Returns an integer < 0 if this substring is
* ordered before the substring of @a str, 0 if their values are * ordered before the substring of @a str, 0 if their values are
* equivalent, or > 0 if this substring is ordered after the substring * equivalent, or > 0 if this substring is ordered after the substring
* of @a str. If the lengths of the substring of @a str and this * of @a str. Determines the effective length rlen of the strings
* substring are different, the shorter one is ordered first. If they * to compare as the smallest of the lengths of the substrings. The
* are the same, returns the result of * function then compares the two strings by calling
* traits::compare(substring.data(),str.substr(pos2,n2).data(),size()); * traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen).
* If the result of the comparison is nonzero returns it, otherwise the
* shorter one is ordered first.
*/ */
int int
compare(size_type __pos1, size_type __n1, const basic_string& __str, compare(size_type __pos1, size_type __n1, const basic_string& __str,
...@@ -1970,9 +1976,12 @@ namespace std ...@@ -1970,9 +1976,12 @@ namespace std
* *
* Returns an integer < 0 if this string is ordered before @a s, 0 if * Returns an integer < 0 if this string is ordered before @a s, 0 if
* their values are equivalent, or > 0 if this string is ordered after * their values are equivalent, or > 0 if this string is ordered after
* @a s. If the lengths of @a s and this string are different, the * @a s. Determines the effective length rlen of the strings to
* shorter one is ordered first. If they are the same, returns the * compare as the smallest of size() and the length of a string
* result of traits::compare(data(),s,size()); * constructed from @a s. The function then compares the two strings
* by calling traits::compare(data(),s,rlen). If the result of the
* comparison is nonzero returns it, otherwise the shorter one is
* ordered first.
*/ */
int int
compare(const _CharT* __s) const; compare(const _CharT* __s) const;
...@@ -1989,10 +1998,13 @@ namespace std ...@@ -1989,10 +1998,13 @@ namespace std
* Form the substring of this string from the @a n1 characters starting * Form the substring of this string from the @a n1 characters starting
* at @a pos. Returns an integer < 0 if the substring is ordered * at @a pos. Returns an integer < 0 if the substring is ordered
* before @a s, 0 if their values are equivalent, or > 0 if the * before @a s, 0 if their values are equivalent, or > 0 if the
* substring is ordered after @a s. If the lengths of @a s and the * substring is ordered after @a s. Determines the effective length
* substring are different, the shorter one is ordered first. If they * rlen of the strings to compare as the smallest of the length of the
* are the same, returns the result of * substring and the length of a string constructed from @a s. The
* traits::compare(substring.data(),s,size()); * function then compares the two string by calling
* traits::compare(substring.data(),s,rlen). If the result of the
* comparison is nonzero returns it, otherwise the shorter one is
* ordered first.
*/ */
int int
compare(size_type __pos, size_type __n1, const _CharT* __s) const; compare(size_type __pos, size_type __n1, const _CharT* __s) const;
...@@ -2009,10 +2021,12 @@ namespace std ...@@ -2009,10 +2021,12 @@ namespace std
* at @a pos1. Form a string from the first @a n2 characters of @a s. * at @a pos1. Form a string from the first @a n2 characters of @a s.
* Returns an integer < 0 if this substring is ordered before the string * Returns an integer < 0 if this substring is ordered before the string
* from @a s, 0 if their values are equivalent, or > 0 if this substring * from @a s, 0 if their values are equivalent, or > 0 if this substring
* is ordered after the string from @a s. If the lengths of this * is ordered after the string from @a s. Determines the effective
* substring and @a n2 are different, the shorter one is ordered first. * length rlen of the strings to compare as the smallest of the length
* If they are the same, returns the result of * of the substring and @a n2. The function then compares the two
* traits::compare(substring.data(),s,size()); * strings by calling traits::compare(substring.data(),s,rlen). If the
* result of the comparison is nonzero returns it, otherwise the shorter
* one is ordered first.
* *
* NB: s must have at least n2 characters, '\0' has no special * NB: s must have at least n2 characters, '\0' has no special
* meaning. * meaning.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment