Topic: STL suggestion
Author: jmk3@crux4.cit.cornell.edu (Jay Krell)
Date: 1995/07/14 Raw View
Have these simple additions to stl been shot down already? :
(Excerpted slightly out of context.)
ternary functions. These are simple. Of course, as well
as pointer_to_ternary_function and, well, in working on
this, I ran into problems with bind3rd. So, another suggestion,
this one I couldn't quite get (should try more), is function
adaptors that swap the order of arguments. I was trying
to bind the middle argument of a ternary_function. Bind2nd
won't work as is, but probably with overloading, I can write
another that accepts a ternary function instead of a binary one.
Also, and identity function akin to times, plus, etc.
It's useful with the composition functions. Which reminds
me of another simple, obvious addition - more compositions.
Like, op1(op2(x), op3(y)). I wrote that in implementing
(experimenation and learning the STL here of course)
subtract(x,y) as plus(identity(x),negate(y)).
I can see this being a typical example.
--
-- Jay jay.krell@cornell.edu http://crux4.cit.cornell.edu/~jmk3 --