Boost logo

Boost Users :

Subject: Re: [Boost-users] Check if a type has a member function (inhrited member functions also) with Boost TTI
From: Edward Diener (eldiener_at_[hidden])
Date: 2014-05-08 13:09:12


On 5/5/2014 1:20 PM, Hijok Payne wrote:
> Boost TTI has very convenient macros for checking if a type has a member
> function. See
> http://www.boost.org/doc/libs/1_55_0/libs/tti/doc/html/the_type_traits_introspection_library/tti_detail_has_member_function.html
>
> If I have not missing something BOOST_TTI_HAS_MEMBER_FUNCTION returns
> false for inherited member functions.

My testing shows that TTI returns false for inherited member functions
which are protected, but works if they are public.

I am working on a solution for inherited protected member functions.

>
> Is there a convenient Boost solution for doing this? There is a SO
> <http://stackoverflow.com/questions/1966362/sfinae-to-check-for-inherited-member-functions> solution
> based on SFINAE. But I would like to avoid that and would prefer a Boost
> solution, since that way I am more sure it works on more compilers and I
> want avoid maintaining code for each such specific behavior.

Thanks for the link. Hopefully this will help me.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net