In the C++ Standard there is written relative to the predicate that
In other words, if an algorithm takes Predicate pred as its argument
and first as its iterator argument, it should work correctly in the
construct pred(*first) contextually converted to bool
The words "contextually converted to bool" means that if even a class defines a conversion function that converts an object of the class to bool as an explicit operator it shall be applied. Consider an example of a contextual conversion to bool
#include <iostream>
struct A
{
explicit operator bool () const { return true; }
};
int main()
{
if ( A() )
{
std::cout << "Here is a contextual conversion to bool" << std::endl;
}
}
So in context of the C++ Standard quote I do not see any sense in writing expression
first != last && !bool( pred(*first ) )
It would be enough to write
first != last && !pred(*first )
Here pred is contextually converted to bool.