I have written type traits for checking, if given class T has_member, then if it either has_non_static_function_member, has_static_function_member or has_non_function_member. These type traits don't take function arguments of the member nor return type to check signature validity (I will provide other type traits for this matter).I want to know if it can be done somehow simpler, and if the current code doesn't have some logical errors. Personally, I think I might have overcomplicated the implementation.Here is initial version:#include <iostream>#include <type_traits>template<class, class = void>struct has_member_xxx : std::false_type{ };template<class T>struct has_member_xxx<    T,    std::void_t<        decltype(&T::xxx)        >    > : std::true_type{ };template<class, class = void>struct has_non_static_member_function_xxx : std::false_type{ };template<class T>struct has_non_static_member_function_xxx<    T,    std::enable_if_t<        std::is_member_function_pointer<            decltype(&T::xxx)        >::value>    > : std::true_type{ };template<class, class = void>struct has_static_member_function_xxx : std::false_type{ };template<class T>struct has_static_member_function_xxx<    T,    std::enable_if_t<        (!has_non_static_member_function_xxx<T>::value) &&        std::is_function<typename std::remove_pointer<decltype(&T::xxx)>::type>::value        >    > : std::true_type{ };template<class, class = void>struct has_non_function_member_xxx : std::false_type{ };template<class T>struct has_non_function_member_xxx<    T,    std::enable_if_t<        has_member_xxx<T>::value &&        (!has_non_static_member_function_xxx<T>::value) &&        (!has_static_member_function_xxx<T>::value)        >    > : std::true_type{ };struct A{    int xxx;};struct B {    int xxx();};struct C {    static int xxx();};int main(){     std::cout << std::boolalpha;    std::cout << has member xxx:  << std::endl;    std::cout << A:  << has_member_xxx<A>::value << std::endl;    std::cout << B:  << has_member_xxx<B>::value << std::endl;    std::cout << C:  << has_member_xxx<C>::value << std::endl << std::endl;    std::cout << has non-static member function xxx << std::endl;    std::cout << A:  << has_non_static_member_function_xxx<A>::value << std::endl;    std::cout << B:  << has_non_static_member_function_xxx<B>::value << std::endl;    std::cout << C:  << has_non_static_member_function_xxx<C>::value << std::endl << std::endl;    std::cout << has static member function xxx << std::endl;    std::cout << A:  << has_static_member_function_xxx<A>::value << std::endl;    std::cout << B:  << has_static_member_function_xxx<B>::value << std::endl;    std::cout << C:  << has_static_member_function_xxx<C>::value << std::endl << std::endl;    std::cout << has non-function member xxx << std::endl;    std::cout << A:  << has_non_function_member_xxx<A>::value << std::endl;    std::cout << B:  << has_non_function_member_xxx<B>::value << std::endl;    std::cout << C:  << has_non_function_member_xxx<C>::value << std::endl << std::endl;}Code is also on Coliru for convenience.
C++ template type traits for class members
c++;template;c++17;sfinae