3 <TITLE>compose3.cpp
</TITLE>
6 <BODY TEXT=
"#000000" BGCOLOR=
"#FFFFFF">
8 <TABLE HEIGHT=
40 WIDTH=
"100%">
9 <TR> <TD ALIGN=LEFT
WIDTH=
"100%" BGCOLOR=
"#DDDDDD">
10 <FONT face=
"Arial,Helvetica" size=+
2><B>
13 </TD></TR></TABLE><BR>
15 <FONT face=
"Arial,Helvetica"><B>
16 The following code example is taken from the book
<BR>
17 <A HREF=
"http://www.josuttis.com/libbook/" TARGET=
"_top">
18 The C++ Standard Library - A Tutorial and Reference
</A><BR>
19 by Nicolai M. Josuttis, Addison-Wesley,
1999<BR>
20 <A HREF=
"http://www.josuttis.com/libbook/copyright.html">
21 © Copyright
</A> Nicolai M. Josuttis
1999<BR>
25 #include
<iostream
><BR>
26 #include
<algorithm
><BR>
27 #include
<functional
><BR>
28 #include
<string
><BR>
29 #include
<cctype
><BR>
30 #include
"<A href="compose.hpp.html
">compose.hpp</A>"<BR>
31 using
namespace
std;
<BR>
32 using
namespace
boost;
<BR>
36 string
s(
"Internationalization");
<BR>
37 string
sub(
"Nation");
<BR>
39 <I><FONT face=
"Arial,Helvetica" color=
"0000FF" size=-
1>//
search
substring
case
insensitive
</I></FONT><BR>
40 string::iterator
pos;
<BR>
41 pos
=
search
(s.begin(),s.end(),
<I><FONT face=
"Arial,Helvetica" color=
"0000FF" size=-
1>//
string
to
search
in
</I></FONT><BR>
42 sub.begin(),sub.end(),
<I><FONT face=
"Arial,Helvetica" color=
"0000FF" size=-
1>//
substring
to
search
</I></FONT><BR>
43 compose_f_gx_hy(equal_to
<int
>(),
<I><FONT face=
"Arial,Helvetica" color=
"0000FF" size=-
1>//
compar.
criterion
</I></FONT><BR>
44 ptr_fun(::toupper),
<BR>
45 ptr_fun(::toupper)));
<BR>
47 if
(pos
!=
s.end())
{
<BR>
48 cout
<< "\"" << sub << "\
" is part of \"" << s << "\
""<BR>
49 << endl;
<BR>
50 }
<BR>