diff --git a/bind.html b/bind.html index 8570bd6..f5bcea0 100644 --- a/bind.html +++ b/bind.html @@ -306,13 +306,13 @@ std::for_each(v.begin(), v.end(), bind(apply<void>(), _1, 5)); evaluation, use protect(bind(f, ...)).
For convenience, the function objects produced by bind overload the - logical not operator ! and the relational operators ==, - !=, <, <=, >, - >=.
+ logical not operator!
and the relational and logical operators ==
,
+ !=
, <
, <=
, >
,
+ >=
, &&
, ||
.
!bind(f, ...) is equivalent to bind( logical_not(), bind(f, ...) ), where logical_not is a function object that takes one argument x and returns !x.
-bind(f, ...) op x, where op is a relational operator, +
bind(f, ...) op x, where op is a relational or logical operator, is equivalent to bind( relation(), bind(f, ...), x ), where relation is a function object that takes two arguments a and b and returns a op b.
@@ -320,7 +320,8 @@ std::for_each(v.begin(), v.end(), bind(apply<void>(), _1, 5));std::remove_if( first, last, !bind( &X::visible, _1 ) ); // remove invisible objects
and compare the result of bind against a value:
-std::find_if( first, last, bind( &X::name, _1 ) == "peter" );
+std::find_if( first, last, bind( &X::name, _1 ) == "Peter" );
+std::find_if( first, last, bind( &X::name, _1 ) == "Peter" || bind( &X::name, _1 ) == "Paul" );
against a placeholder:
bind( &X::name, _1 ) == _2
or against another bind expression: