|
Boost : |
From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2001-05-15 03:28:24
Hi,
while using function objects more and more, it seems to me that either
I'm missing something or the STL and/or boost's compose.hpp is missing
something :)
If a have a common template class working with a binary function f(a,b),
I instantiate it to perform operations like a/b, a-b, (a-1)*b which is
easy. But sometimes, I need to return just 'b', I mean f(a,b)=b. I could
define it as f(a,b)=0*a+b, but that is IMHO bad.
I haven't seen any function in the STL or in boost's compose.hpp to
select just the first or second parameter. If they exists and I missed
them, please point me to the right header. If they don't exist: Should
we add 'select1st' and 'select2nd' to compose.hpp? Or are there better
names?
Regards, Daniel
-- Daniel Frey aixigo AG - financial training, research and technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk