.\" ident @(#)logical_not.3 .\" Standard Template Library .\" $$RW_INSERT_HEADER "slyrs.man" .TH logical_not 3C++ "02 Apr 1998" "Rogue Wave Software" "-" .ce2 Standard C++ Library Copyright 1998, Rogue Wave Software, Inc. .SH NAME \f2logical_not\fP \ - A unary function object that returns \f2true\fP if its argument is \f2false\fP. .SH SYNOPSIS .br #include .br template .br struct logical_not : unary_function ; .SH DESCRIPTION logical_not is a unary function object. Its \f2operator()\fP returns \f2true\fP if its argument is \f2false\fP. 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 \f2true\fP. logical_not is used in that algorithm in the following manner: .br vector vec1; .br . .br . .br . .br void replace_if(vec1.begin(), vec1.end(), .RE .RS 16 logical_not(),1); .RE This call to replace_if replaces all zeros in the \f2vec1\fP with \f21\fP. .SH INTERFACE .RE .RS 0 template .br struct logical_not : unary_function { .RE .RS 1 bool operator() (const T&) const; .RE .RS 0 }; .SH WARNINGS If your compiler does not support default template parameters, you always need to supply the \f2Allocator\fP template argument. For instance, you have to write: \f2vector >\fP instead of: \f2vector\fP If your compiler does not support namespaces, then you do not need the using declaration for \f2std\fP. .SH SEE ALSO Function_Objects, unary_function