On Mon, Aug 11, 2008 at 9:33 AM, joel falcou
I was trying to use it as a simple traits to see if a given type fullfilled the result_of protocol whatever the arguments used. It works ok for the result_type variant but now I see it's still incomplete. The problem is that I can't see, for an arbitrary result structure, how I can see if it actually has at least one overload that has a proper nested type typedef.
I can't either :-)
Typical use is :
For F a given type, support_result_of_protocol<F>::type evaluates as a compile time boolean indicating if either F has a nested result structure or result_type typedef. It doesn't make any assumptions on wether or nor result is correcly implemented.
As for testing if a particuliar set of arguments produces a valid result_of, one can easily do :
template< class F , template<class> class T = boost::result_of<F>::type > struct valid_impl { typedef void type; };
template
struct produce_valid_result_of : boost::false_type {}; template<class F> struct produce_valid_result_of
: boost::true_type {}; or did I miss something in your question ?
I think you got my question, but that won't work. If you fix it to:
template< class F
, typename T = typename boost::result_of<F>::type
> struct valid_impl
{
typedef void type;
};
template