Hi all,
The following code only works under g++ 4.x:
#include <boost/type_traits.hpp>
template <class T>
struct is_functor_helper
{
static boost::type_traits::no_type test (...);
template <class U>
static boost::type_traits::yes_type test (U*, typeof(&U::operator()) dummy = NULL);
BOOST_STATIC_CONSTANT (bool, value = sizeof(test((T*)NULL)) == sizeof(boost::type_traits::yes_type));
};
template <class T> struct is_functor: public boost::integral_constant<bool, is_functor_helper<T>::value> { };
Can anyone give me a hint to make it work under other toolset, please ?
Thanks in advance.
Regards,
Trung An Tran