diff options
author | Jonathan Wakely <redi@gcc.gnu.org> | 2005-06-17 17:26:13 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2005-06-17 17:26:13 +0100 |
commit | 0ec56ba3259398111215f0255cdb3c561e51ae3e (patch) | |
tree | abfd4274c49ca902665c5c6fa5ac6ba6c4a78fa4 /libstdc++-v3/docs | |
parent | 853a4203b72296bc59f14ae6e8c467208e9679d2 (diff) | |
download | gcc-0ec56ba3259398111215f0255cdb3c561e51ae3e.zip gcc-0ec56ba3259398111215f0255cdb3c561e51ae3e.tar.gz gcc-0ec56ba3259398111215f0255cdb3c561e51ae3e.tar.bz2 |
* docs/html/21_strings/gotw29a.txt: Update code to corrected version.
From-SVN: r101130
Diffstat (limited to 'libstdc++-v3/docs')
-rw-r--r-- | libstdc++-v3/docs/html/21_strings/gotw29a.txt | 6 |
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 d823f30..9326604 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; |