lundi 14 décembre 2020

How to make this enable_if expression simpler?

How to make this expression simpler?

I want to confirm the pointer is not a type as follow:

not a function pointer(i.e pointer to lua_CFunction),

not a pointer to std::string,

not a pointer to char,

not a pointer to unsigned char.

              template <typename T, 
              typename std::enable_if<(std::is_same<lua_CFunction, T*>::value)
                                   && std::is_pointer<T>::value
                                   && (!std::is_same<std::string*, T>::value)
                                   && (!std::is_same<unsigned char, std::remove_cv<std::remove_pointer<T>>>::value)
                                   && (!std::is_same<         char, std::remove_cv<std::remove_pointer<T>>>::value)>
                                   ::type* = nullptr>

Aucun commentaire:

Enregistrer un commentaire