TITLE: function adaptors not in the standard (Source: comp.std.c++, 13 Feb 2001) DIENER: Edward Diener >> A number of function obects and function adaptors mentioned in books >> which I have on the C++ standard library were left out of the >> standard. Most notable are unary_compose<>, binary_compose<>, identity<>, >> project1st<>, project2nd<>, select1st<>, and select2nd<>. Is there a >> reason these were left out of the standard ? Were they seen as not >> being popular or useful enough ? KUYPER: "James Kuyper Jr." > For the sake of those of us who are unfamiliar with them, could you > describe what they do? AUSTERN: "Matthew Austern" unary_compose takes two function objects f(x) and g(x), and creates a function object that computes f(g(x)). binary_compose takes three function object f(x, y), g1(x), and g2(x), and creates a unary function object that computes f(g1(x), g2(x)). project1st takes two arguments, x and y, and returns x. project2nd returns y. identity takes one argument, x, and returns x. select1st and select2nd both take a single argument, a pair; select1st returns the first argument, select2nd returns the second. All of those functions were part of the original pre-standard STL, and they were removed when the STL became partof the C++ standard. My guess is that those functions, or something like them but with small interface changes, will become part of a future revision of the C++ standard. _______________________________________________ cpptips mailing list http://cpptips.hyperformix.com