|
Boost : |
From: Matt Austern (austern_at_[hidden])
Date: 2001-04-04 19:12:11
David Abrahams wrote:
> > I wrote a replacement for <functional> several years ago that worked
> > for function pointers as well, and allowed one to distinguish the
> > unadorned argument or return type (e.g., foo) from the full argument
> > or return type (e.g., foo &, foo const &, or foo). If there's any
> > interest, I can dig it up and post it to the list.
>
> Yes! I always been frustrated by having to remember the
> AdaptableUnaryFunction distinction, and where it was needed... but most of
> all by the fact that I knew it was unneccessary.
It's on my list for the library extension TR.
It seems to me that things like extracting the unadorned
argument are now unnecessary (that's what call_traits and
the like are for, no?), but a simple functor_traits class,
no more complicated than iterator_traits, would be
useful.
(Actually it has to be a little more complicated than
iterator_traits, because function pointers are compliated.
There's the nuisance that if you've got
void f1();
extern "C" void f2();,
then &f1 and &f2 are different types.
--Matt
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk