Copyright (C) 2000-2012 |
Whole document tree project1st<Arg1, Arg2>
DescriptionProject1st is a function object that takes two arguments and returns its first argument; the second argument is unused. It is essentially a generalization of identity to the case of a Binary Function.Exampleint main() { vector<int> v1(10, 137); vector<char*> v2(10, (char*) 0); vector<int> result(10); transform(v1.begin(), v1.end(), v2.begin(), result.begin(), project1st<int, char*>()); assert(equal(v1.begin(), v1.end(), result.begin())); } DefinitionDefined in the standard header functional, and in the nonstandard backward-compatibility header function.h. This function object is an SGI extension; it is not part of the C++ standard.Template parameters
Model ofAdaptable Binary FunctionType requirementsNone.Public base classesbinary_function<Arg1, Arg2, Arg1>Members
New membersAll of project1st's members are defined in the Adaptable Binary Function requirements. project1st does not introduce any new members.NotesSee alsoFunction objects, identity, project2nd, select1st, select2ndCopyright © 1999 Silicon Graphics, Inc. All Rights Reserved. TrademarkInformation
|