From 1aa19446366bd4c8645bce7a1bc4bd0698d6d519 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 9 May 2012 17:11:43 +0000 Subject: [PATCH] Fixed error in string docs [SVN r78393] --- string/doc/usage.xml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/string/doc/usage.xml b/string/doc/usage.xml index 291a525..142bb2e 100644 --- a/string/doc/usage.xml +++ b/string/doc/usage.xml @@ -135,12 +135,12 @@ << endl; // prints "command.com is an executable" //.. - char text1[]="hello world!"; + char text1[]="hello"; cout << text1 - << (all( text1, is_lower() )? "is": "is not") + << (all( text1, is_lower() )? " is": " is not") << " written in the lower case" - << endl; // prints "hello world! is written in the lower case" + << endl; // prints "hello is written in the lower case" The predicates determine whether if a substring is contained in the input string @@ -149,6 +149,11 @@ simply contains the substring or if both strings are equal. See the reference for boost/algorithm/string/predicate.hpp for more details. + + Note that if we had used "hello world" as the input to the test, it would have + output "hello world is not written in the lower case" because the space in the + input string is not a lower case letter. + In addition the algorithm all() checks all elements of a container to satisfy a condition specified by a predicate.