summaryrefslogtreecommitdiff
path: root/libstdc++-v3/docs
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-17 16:26:13 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-17 16:26:13 +0000
commit23b5354c259909fcf36e970d0114d8536bc330fb (patch)
treeabfd4274c49ca902665c5c6fa5ac6ba6c4a78fa4 /libstdc++-v3/docs
parent98f983d792009ade6cbc2827888d6a2a9be6e61e (diff)
downloadgcc-23b5354c259909fcf36e970d0114d8536bc330fb.tar.gz
* docs/html/21_strings/gotw29a.txt: Update code to corrected version.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101130 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/docs')
-rw-r--r--libstdc++-v3/docs/html/21_strings/gotw29a.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/libstdc++-v3/docs/html/21_strings/gotw29a.txt b/libstdc++-v3/docs/html/21_strings/gotw29a.txt
index d823f30504e..9326604855e 100644
--- a/libstdc++-v3/docs/html/21_strings/gotw29a.txt
+++ b/libstdc++-v3/docs/html/21_strings/gotw29a.txt
@@ -119,10 +119,14 @@ the easiest way:
while( n-- > 0 && tolower(*s) != tolower(a) ) {
++s;
}
- return s;
+ return n >= 0 ? s : 0;
}
};
+[N.B. A bug in the original code has been fixed for the
+GCC documentation, the corrected code was taken from
+Herb Sutter's book, Exceptional C++]
+
And finally, the key that brings it all together:
typedef basic_string<char, ci_char_traits> ci_string;