
joel falcou wrote:
I fear you must resort to BOOST_TYPEOF.
The problem is that you cannot use BOOST_TYPEOF with void expressions it seems. Here is what his code expands in : -------------------------------------------------------------------- namespace boost { namespace type_of { template<typename T> typename enable_if<is_function<T>, T&>::type ensure_obj(T&); template<typename T> typename disable_if<is_function<T>, T&>::type ensure_obj(const T&); }} void returns_void(); int returns_int(); int main() { std::cout<<std::boolalpha; std::cout<<boost::is_void< __typeof__(boost::type_of::ensure_obj(void))
::value<<'\n';
return 0; } -------------------------------------------------------------------- The ensure_obj expansion fails because T cannot be void. -- Maxime