.\" ident @(#)equal_to.3 .\" Standard Template Library .\" $$RW_INSERT_HEADER "slyrs.man" .TH equal_to 3C++ "02 Apr 1998" "Rogue Wave Software" "-" .ce2 Standard C++ Library Copyright 1998, Rogue Wave Software, Inc. .SH NAME \f2equal_to\fP \ - A binary function object that returns \f2true\fP if its first argument equals its second. .SH SYNOPSIS .br #include .br template .br struct equal_to; .SH DESCRIPTION equal_to is a binary function object. Its \f2operator()\fP returns \f2true\fP if \f2x\fP is equal to \f2y\fP. You can pass an equal_to object to any algorithm that requires a binary function. For example, the transform algorithm applies a binary operation to corresponding values in two collections and stores the result. equal_to would be used in that algorithm in the following manner: .br vector vec1; .br vector vec2; .br vector vecResult; .br . .br . .br . .br transform(vec1.begin(), vec1.end(), .RE .RS 9 vec2.begin(), vecResult.begin(), .RE .RS 10 equal_to()); .RE After this call to transform, \f2vecResult(n)\fP contains a \f21\fP if \f2vec1(n)\fP was equal to \f2vec2(n)\fP or a \f20\fP if \f2vec1(n)\fP was not equal to \f2vec2(n)\fP. .SH INTERFACE .RE .RS 0 template .RE .RS 3 struct equal_to : binary_function .SH SEE ALSO binary_function, Function_Objects