[Feature] Boost.Type_Traits support for member functions

I'd like to recommend the addition of code for handling of pointers to member functions to Boost.Type_Traits. This is a simple modification, but I am unaware of the ramifications on other compilers (Perhaps someone else could shed some light on this?) Since this is my first post here, please inform me if I did anything wrong. :) Peregrine Falcon //// Original Code: #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION /*...*/ template<typename R> struct function_traits_helper<R (*)(void)> { BOOST_STATIC_CONSTANT(int, arity = 0); typedef R result_type; }; /* etc. */ #else /*...*/ template<typename R> type_of_size<1> function_arity_helper(R (*f)()); /* etc. */ #endif //// New code: #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION /*...*/ template<typename R, typename C> struct function_traits_helper<R (C::*)(void)> { BOOST_STATIC_CONSTANT(int, arity = 0); typedef R result_type; typedef C class_type; }; /* etc. */ #else /*...*/ template<typename R, typename C> type_of_size<1> function_arity_helper(R (C::*f)()); /* etc. */ #endif

Hi, Falcon wrote:
I'd like to recommend the addition of code for handling of pointers to member functions to Boost.Type_Traits. This is a simple modification,
Incidentally, there is a small library, FunctionTypes, that deals with this issue in very much detail (like function pointers, function references, member function pointers, their const/volatile qualification, printf-style '...' parameters and calling convention attributes). It is not part of Boost, but currently under review. This means the community evaluates whether it should become a part of Boost or not (details on the review process can be found here: http://tinyurl.com/2nljq). ZIP-Archive: http://tinyurl.com/4oe7q Online docus: http://tinyurl.com/4fw9n Discussion: see the threads with "[function types]" in their topic Regards, Tobias
participants (2)
-
Falcon
-
Tobias Schwinger