Zitat von Steven Watanabe
Yes. The code looks something like this:
typedef char no; struct yes { char dummy[2]; };
struct has_on_result { has_on_result operator,(int); };
no check_on_result(const has_on_result&); yes check_on_result(...);
template<class T> struct has_on_impl : T { using T::on; has_on_result on(...); };
template
struct has_on : boost::mpl::bool_< sizeof(check_on_result(((has_on_impl<T>*)0)->on(*((M*)0)) , 0)) != sizeof(no) {};
how does this work with member functions that have a "void" result? does it? how does this work at all? "using T::on" is invalid when T doesn't have "on", so the instantiation of has_on<>, that should result in mpl::false_, fails. do you have a link to actual code that uses this? thanks