Am 07.03.2013 20:12, schrieb Jeffrey Lee Hellrung, Jr.:
The macro you're looking for is BOOST_TTI_HAS_MEMBER_FUNCTION.
it requires you to know the exact signature of the member function. I'm trying to check whether it is ok to call c.f(x), which would be satisfied by each of the following 3 signatures (and more):
struct C{ void f(X); void f(X &); void f(X const &); ... };
is there a way to check for that, or do I have to check for all (likely) signatures?
https://groups.google.com/group/comp.lang.c++.moderated/tree/browse_frm/thre...
Thanks! it doesn't work for me, because it uses sizeof(void) if the function call is possible. However, it is enough to determine whether a member of a given name exists, without checking the signature. an implementation of has_member is here: http://www.rsdn.ru/forum/cpp/2720363 Edward, can this be added to TTI, for example as BOOST_TTI_HAS_MEMBER? not only does this implementation look portable to me, but boost already uses it internally: http://www.boost.org/doc/libs/1_47_0/boost/thread/locks.hpp Stefan