Agoston Bejo
Hi, I have took a look at some parts of the boost library, but I couldn't find what I want, and that is something like this: How can I determine if a type T has such and such member? It would look like something like this:
has_member
::result (true if T::paint() exists) has_member ::result (true if T::m_size exists) The closest to this I could find is boost::type_traits but that does not provide this functionality.
Unfortunately that is impossible because templates can only manipulate constants, types and templates, not names. There is a technique that can be used to detect the definition of most operators, but it requires a separate template for each operator and it depends on being able to overload the operators through non-member functions. There may be a way to detect member functions but it cannot be done generically.