I am trying to understand how I can get code to compile that will determine the size of the return value of T, where T is the prototype of the function in my function template.
template<typename T> void functionReturnLength() { long lReturnTypeSize = boost::mpl::eval_if< boost::is_void<boost::function_types::result_type<T>::type>::value, boost::mpl::long_<0>, boost::mpl::long_<boost::mpl::sizeof_<boost::function_types::result_type<T>::type>::value>>::value; }
However, it still does not compile because sizeof (void) is not a valid operation - even if I try to build an if statement that will return size 0 if the type is invalid. I am new to BOOST MPL, so while I have been looking through the documentation for some time, I am not sure how I could apply other ifs like if_ or apply_if, and even if they worked.
Thanks.
source share