fixed parens and tabs

This commit is contained in:
Frank B. Brokken 2015-05-27 16:19:44 +02:00
parent ab45ea1306
commit 2f0414d13a
4 changed files with 8 additions and 8 deletions

View file

@ -27,7 +27,7 @@ strings that are equal to a string (tt(target)) in a vector of strings
(tt(vs)) (it is assumed that the required headers and tt(using namespace std)
have been specified):
verb(
count_if(vs.begin(), vs.end(), bind2nd(equal_to<string>(), target);
count_if(vs.begin(), vs.end(), bind2nd(equal_to<string>(), target));
)
In this example the function object tt(equal_to) is instantiated for
strings, receiving tt(target) as its second argument, and each of the strings
@ -137,11 +137,11 @@ tt(bind). E.g.,
using tt(bind) like this:
verb(
using namespace placeholders;
count_if(vs.begin(), vs.end(), bind(equal_to<string>(), _1, target);
count_if(vs.begin(), vs.end(), bind(equal_to<string>(), _1, target));
)
Here, tt(bind) returns a functor expecting one argument (represented by
tt(_1) and tt(count_if) will pass the strings in tt(vs) will in sequence to
the functor returned by tt(bind). The second argument (tt(target) is embedded
tt(_1)) and tt(count_if) will pass the strings in tt(vs) will in sequence to
the functor returned by tt(bind). The second argument (tt(target)) is embedded
inside the functor's implementation, where it is passed as second argument to
the tt(equal_to<string>()) function object.