logical_not is a unary function object. Its operator() returns true if its argument is false. You can pass a logical_not object to any algorithm that requires a unary function. For example, the replace_if() algorithm replaces an element with another value if the result of a unary operation is true. logical_not is used in that algorithm in the following manner: