[bind][function_types] Why do bind objects not have an ::arity, ... interface ?

Hi, I want to use a partial template specialisation which is selected on basis of the arity of a bind function object type. Event more, I'd like to access the ::arg1_type, etc types of a bind object type. Why is this not part of the boost::bind or lambda::bind interface ? I thought solving it with the (to be accepted) function_types::function_type_arity<BoundType>::type::value, but the latest version of function_types does not 'support' inspection of bound object types. Other library writers must have felt a need for this interface as well ? Or am I missing something ? With kind regards, Peter Soetens -- Peter Soetens -- FMTC -- <http://www.fmtc.be>

Peter Soetens wrote:
Hi,
I want to use a partial template specialisation which is selected on basis of the arity of a bind function object type. Event more, I'd like to access the ::arg1_type, etc types of a bind object type. Why is this not part of the boost::bind or lambda::bind interface ?
boost::bind objects do not have fixed argument types or a fixed arity (although they do have a minimum arity).

Peter Soetens wrote:
I thought solving it with the (to be accepted) function_types::function_type_arity<BoundType>::type::value, but the latest version of function_types does not 'support' inspection of bound object types.
The proposed FunctionTypes library is designed to provide introspection and synthesis of builtin types and portably deal with compiler extensions and bugs. Support for classes that model the functor concept is simply not what the library is for (you probably knew and that's the reason why the word 'support' is quoted, I figure).
Other library writers must have felt a need for this interface as well ?
Well I did, that's why FunctionTypes exists ;-) because -->
Or am I missing something ?
--> you can, however, use FunctionTypes on '&T::operator()' but operator() must neither be templated nor ambiguously overload for things to work (as with e.g. Boost.Function), otherwise (as with e.g. Boost.Bind) detection without help from the functor (an 'arity' member constant or the like) is not implementable. Regards, Tobias
participants (3)
-
Peter Dimov
-
Peter Soetens
-
Tobias Schwinger