|
Boost Users : |
From: John Maddock (john_at_[hidden])
Date: 2007-10-02 10:38:41
Kirit Sælensminde wrote:
>
> I think I have a misunderstanding of what the boost::function_traits
> is doing. From your explanation it seems that boost::function_traits
> is there to examine only function signatures where a function type is
> of the form R( A1, A2, etc. ),
Correct.
> whereas I'm thinking of it as
> something to examine any unambiguous callable item. I.e. function
> pointers, member functions, all kinds of lambdas etc.
>
> What I've found is that if I add the specialisations to
> boost::details::function_traits_helper I *can* use it how I expect.
>
> Is the reason for leaving them out? Something technical that I'm
> missing so I'm just storing up trouble for myself in the long run?
>
> What is the proper way of doing this? Given a choice between having to
> write lots of overloaded functions to deal with the different
> possibilities every time I want to write a function that needs to do
> some type deduction and adding specialisations just once I know which
> feels most appealing.
How about result_of: http://www.boost.org/libs/utility/utility.htm#result_of
?
John
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net