From 0ec56ba3259398111215f0255cdb3c561e51ae3e Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 17 Jun 2005 17:26:13 +0100 Subject: [PATCH] * docs/html/21_strings/gotw29a.txt: Update code to corrected version. From-SVN: r101130 --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/docs/html/21_strings/gotw29a.txt | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index dc56f54939c..649c017d860 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2005-06-17 Jonathan Wakely + + * docs/html/21_strings/gotw29a.txt: Update code to corrected version. + 2005-06-17 Jakub Jelinek Benjamin Kosnik 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 ci_string; -- 2.30.2